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

Method notifyMovement

game/state/battle/battlescanner.cpp:109–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void BattleScanner::notifyMovement(Vec3<int> position)
110{
111 static const Vec3<int> midPos = {MOTION_SCANNER_X / 2, MOTION_SCANNER_Y / 2, 0};
112
113 // FIXME: Fix display of big units
114 auto pos = position - lastPosition + midPos;
115 if (pos.x < 0 || pos.y < 0 || pos.x >= MOTION_SCANNER_X || pos.y >= MOTION_SCANNER_Y)
116 {
117 return;
118 }
119 version++;
120 movementTicks[pos.y * MOTION_SCANNER_X + pos.x] = TICKS_SCANNER_REMAIN_LIT;
121}
122} // namespace OpenApoc

Callers 1

notifyScannersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected