Now missiles spawn in the center of unit, not in the center of top-left tile. Offset (if needed) must be set in the units declaration lua-files by MissileOffsets = {}

This commit is contained in:
alyokhin 2020-04-13 22:21:40 +03:00
parent 9685d575bc
commit 50596ed6c5

View file

@ -396,7 +396,7 @@ void FireMissile(CUnit &unit, CUnit *goal, const Vec2i &goalPos)
// If Firing from inside a Bunker
CUnit *from = GetFirstContainer(unit);
const int dir = ((unit.Direction + NextDirection / 2) & 0xFF) / NextDirection;
const PixelPos startPixelPos = Map.TilePosToMapPixelPos_Center(from->tilePos)
const PixelPos startPixelPos = from->GetMapPixelPosCenter()
+ unit.Type->MissileOffsets[dir][0];
Vec2i dpos;