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

Method removeFromMap

game/state/tilemap/tileobject_battleunit.cpp:209–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void TileObjectBattleUnit::removeFromMap()
210{
211 bool requireRecalc = owningTile != nullptr;
212 std::set<Tile *> prevIntersectingTiles;
213 for (auto &t : intersectingTiles)
214 {
215 prevIntersectingTiles.insert(t);
216 }
217
218 TileObject::removeFromMap();
219 if (requireRecalc)
220 {
221 for (auto &t : intersectingTiles)
222 {
223 prevIntersectingTiles.erase(t);
224 }
225 for (auto &t : prevIntersectingTiles)
226 {
227 t->updateBattlescapeUnitPresent();
228 }
229 }
230}
231
232void TileObjectBattleUnit::setPosition(Vec3<float> newPosition)
233{

Callers

nothing calls this directly

Calls 2

insertMethod · 0.80

Tested by

no test coverage detected