Don't desynch on embarking nor crash on disembarking.
parent
1481ec6830
commit
aea0933672
32
src/order.c
32
src/order.c
|
@ -851,26 +851,24 @@ void orderUpdateDroid(DROID *psDroid)
|
||||||
else if (abs((SDWORD)psDroid->pos.x - (SDWORD)psDroid->psTarget->pos.x) < TILE_UNITS
|
else if (abs((SDWORD)psDroid->pos.x - (SDWORD)psDroid->psTarget->pos.x) < TILE_UNITS
|
||||||
&& abs((SDWORD)psDroid->pos.y - (SDWORD)psDroid->psTarget->pos.y) < TILE_UNITS)
|
&& abs((SDWORD)psDroid->pos.y - (SDWORD)psDroid->psTarget->pos.y) < TILE_UNITS)
|
||||||
{
|
{
|
||||||
// if in multiPlayer, only want to process if this player's droid
|
// save the target of current droid (the transporter)
|
||||||
if (!bMultiPlayer || psDroid->player == selectedPlayer)
|
DROID * transporter = (DROID *)psDroid->psTarget;
|
||||||
{
|
|
||||||
// save the target of current droid (the transporter)
|
|
||||||
DROID * transporter = (DROID *)psDroid->psTarget;
|
|
||||||
|
|
||||||
// Make sure that it really is a valid droid
|
// Make sure that it really is a valid droid
|
||||||
CHECK_DROID(transporter);
|
CHECK_DROID(transporter);
|
||||||
|
|
||||||
// order the droid to stop so moveUpdateDroid does not process this unit
|
// order the droid to stop so moveUpdateDroid does not process this unit
|
||||||
orderDroid(psDroid, DORDER_STOP);
|
turnOffMultiMsg(true); // Do this now, since synchronised. If sending later, it's too late.
|
||||||
setDroidTarget(psDroid, NULL);
|
orderDroid(psDroid, DORDER_STOP);
|
||||||
psDroid->psTarStats = NULL;
|
turnOffMultiMsg(false);
|
||||||
secondarySetState(psDroid, DSO_RETURN_TO_LOC, DSS_NONE);
|
setDroidTarget(psDroid, NULL);
|
||||||
|
psDroid->psTarStats = NULL;
|
||||||
|
secondarySetState(psDroid, DSO_RETURN_TO_LOC, DSS_NONE);
|
||||||
|
|
||||||
/* We must add the droid to the transporter only *after*
|
/* We must add the droid to the transporter only *after*
|
||||||
* processing changing its orders (see above).
|
* processing changing its orders (see above).
|
||||||
*/
|
*/
|
||||||
transporterAddDroid(transporter, psDroid);
|
transporterAddDroid(transporter, psDroid);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (psDroid->action == DACTION_NONE)
|
else if (psDroid->action == DACTION_NONE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue