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

Method markUnVisible

game/state/battle/battleunit.cpp:4554–4579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4552}
4553
4554void BattleUnit::markUnVisible(GameState &state)
4555{ // Remove from list of visible units
4556 StateRef<BattleUnit> srThis = {&state, id};
4557 for (auto &units : state.current_battle->visibleUnits)
4558 {
4559 if (units.first != owner)
4560 {
4561 units.second.erase(srThis);
4562 }
4563 }
4564 for (auto &units : state.current_battle->visibleEnemies)
4565 {
4566 if (units.first != owner)
4567 {
4568 units.second.erase(srThis);
4569 }
4570 }
4571 for (auto &unit : state.current_battle->units)
4572 {
4573 if (unit.second->owner != owner)
4574 {
4575 unit.second->visibleUnits.erase(srThis);
4576 unit.second->visibleEnemies.erase(srThis);
4577 }
4578 }
4579}
4580
4581void BattleUnit::retreat(GameState &state)
4582{

Callers 2

dropDownMethod · 0.95
retreatMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected