Skip to content

Commit f2301ca

Browse files
committed
Copy bRemovedFromPlay flag from proxy VIP units (#465)
Mods were unable to check whether VIP units left a mission or not because the `bRemovedFromPlay` flag was not being copied across to the original reward unit. This change fixes that behaviour if the `CHHelpers.PreserveProxyUnitData` config variable is set to `true`.
1 parent ba117b9 commit f2301ca

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ All notable changes to Vanilla 'War Of The Chosen' Behaviour will be documented
217217
no broken duo poses for units that can't play them (#309)
218218
- Additional Photobooth particle system enums for mods (#359)
219219
- Tweaks to "Resistance Archives" random Legacy Operations UI. Restarts show the correct locked difficulty, and a crash condition on backing out of a restart fixed. (#307)
220+
- Allow mods to check whether VIP units left a mission successfully via the `bRemovedFromPlay`
221+
flag on `XComGameState_Unit`. This behavior is gated behind the new `CHHelpers.PreserveProxyUnitData`
222+
config variable. (#465)
220223

221224

222225
### Fixes

X2WOTCCommunityHighlander/Config/XComGame.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ bEnableVersionDisplay=true
2323
;AmmoSlotBypassUniqueRule=false ; Set to true to make ammo slot ignore unique items rule.
2424

2525
;bDontUnequipWhenWounded=true ; Set to true to make soldier keep their gear when wounded
26-
;bDontUnequipCovertOps=true ; Uncomment to make soldiers on covert ops keep their gear even if ambush risk is 0
26+
;bDontUnequipCovertOps=true ; Uncomment to make soldiers on covert ops keep their gear even if ambush risk is 0
27+
28+
;PreserveProxyUnitData=true ; Set to true to make sure important info on proxy VIP units is copied to the original units

X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ var config(Content) array<name> EyeMaterial;
110110
var config(Content) array<name> FlagMaterial;
111111
// End Issue #356
112112

113+
// Start Issue #465
114+
var config bool PreserveProxyUnitData;
115+
// End Issue #465
116+
113117
// Start Issue #123
114118
simulated static function RebuildPerkContentCache() {
115119
local XComContentManager Content;

X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameStateContext_StrategyGameRule.uc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,13 @@ static function CleanupProxyVips()
12931293
OriginalUnit.SetCurrentStat(eStat_HP, ProxyUnit.GetCurrentStat(eStat_HP));
12941294
}
12951295
1296+
// Start Issue #465
1297+
if (class'CHHelpers'.default.PreserveProxyUnitData && ProxyUnit.bRemovedFromPlay)
1298+
{
1299+
OriginalUnit.RemoveStateFromPlay();
1300+
}
1301+
// End Issue #465
1302+
12961303
// remove the proxy from the game. We don't need it anymore
12971304
NewGameState.RemoveStateObject(ProxyUnit.ObjectID);
12981305
}

0 commit comments

Comments
 (0)