Permalink
Browse files

Do not land all 150 VTOLs on the same tile.

  • Loading branch information...
Cyp committed Feb 28, 2012
1 parent ce3e76c commit 9dcf5bdf4eb4d590ea15e1c5201ceefe0819a5dc
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/move.cpp
View
@@ -2479,7 +2479,19 @@ void moveUpdateDroid(DROID *psDroid)
// No more waypoints - finish
if ( psPropStats->propulsionType == PROPULSION_TYPE_LIFT )
{
- psDroid->sMove.Status = MOVEHOVER;
+ // check the location for vtols
+ Vector2i tar = removeZ(psDroid->pos);
+ if (psDroid->order.type != DORDER_PATROL && psDroid->order.type != DORDER_CIRCLE // Not doing an order which means we never land (which means we might want to land).
+ && actionVTOLLandingPos(psDroid, &tar) // Can find a sensible place to land.
+ && map_coord(tar) != map_coord(psDroid->sMove.destination)) // We're not at the right place to land.
+ {
+ psDroid->sMove.destination = tar;
+ moveDroidTo(psDroid, psDroid->sMove.destination.x, psDroid->sMove.destination.y);
+ }
+ else
+ {
+ psDroid->sMove.Status = MOVEHOVER;
+ }
}
else
{

0 comments on commit 9dcf5bd

Please sign in to comment.