MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / changeOwner

Method changeOwner

game/state/battle/battleunit.cpp:1228–1242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226}
1227
1228void BattleUnit::changeOwner(GameState &state, StateRef<Organisation> newOwner)
1229{
1230 if (owner == newOwner)
1231 {
1232 return;
1233 }
1234 refreshUnitVision(state, true);
1235 stopAttacking();
1236 stopAttackPsi(state);
1237 cancelMissions(state);
1238 removeFromSquad(*state.current_battle);
1239 owner = newOwner;
1240 assignToSquad(*state.current_battle);
1241 refreshUnitVisibilityAndVision(state);
1242}
1243
1244void BattleUnit::setReserveShotMode(GameState &state, ReserveShotMode mode)
1245{

Callers 2

stopAttackPsiMethod · 0.80
updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected