mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- fixed meeting point crash on edge of map
This commit is contained in:
parent
25204e0084
commit
4cb2485cdf
@ -556,7 +556,15 @@ bool World::placeUnit(const Vec2i &startLoc, int radius, Unit *unit, bool spacia
|
||||
|
||||
if(freeSpace) {
|
||||
unit->setPos(pos);
|
||||
unit->setMeetingPos(pos-Vec2i(1));
|
||||
Vec2i meetingPos = pos-Vec2i(1);
|
||||
if(meetingPos.x < 0) {
|
||||
meetingPos.x = 0;
|
||||
}
|
||||
if(meetingPos.y < 0) {
|
||||
meetingPos.y = 0;
|
||||
}
|
||||
|
||||
unit->setMeetingPos(meetingPos);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user