When canceling or completing build orders, make sure we clear the complete droid
state, otherwise other parts of the code can become confused and think they are busy. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9748 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
a2b0a70764
commit
0da62cbc99
|
@ -120,6 +120,9 @@ void droidUpdateRecoil( DROID *psDroid );
|
||||||
static void cancelBuild(DROID *psDroid)
|
static void cancelBuild(DROID *psDroid)
|
||||||
{
|
{
|
||||||
psDroid->action = DACTION_NONE;
|
psDroid->action = DACTION_NONE;
|
||||||
|
psDroid->order = DORDER_NONE;
|
||||||
|
setDroidTarget(psDroid, NULL);
|
||||||
|
setDroidActionTarget(psDroid, NULL, 0);
|
||||||
|
|
||||||
/* Notify scripts we just became idle */
|
/* Notify scripts we just became idle */
|
||||||
psScrCBOrderDroid = psDroid;
|
psScrCBOrderDroid = psDroid;
|
||||||
|
|
|
@ -1196,14 +1196,15 @@ void structureBuild(STRUCTURE *psStruct, DROID *psDroid, int buildPoints)
|
||||||
intRefreshScreen(); // update any open interface bars.
|
intRefreshScreen(); // update any open interface bars.
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not needed, but left for backward compatibility */
|
|
||||||
structureCompletedCallback(psStruct->pStructureType);
|
|
||||||
|
|
||||||
/* must reset here before the callback, droid must have DACTION_NONE
|
/* must reset here before the callback, droid must have DACTION_NONE
|
||||||
in order to be able to start a new built task, doubled in actionUpdateDroid() */
|
in order to be able to start a new built task, doubled in actionUpdateDroid() */
|
||||||
if (psDroid)
|
if (psDroid)
|
||||||
{
|
{
|
||||||
psDroid->action = DACTION_NONE;
|
psDroid->action = DACTION_NONE;
|
||||||
|
psDroid->order = DORDER_NONE;
|
||||||
|
setDroidTarget(psDroid, NULL);
|
||||||
|
setDroidActionTarget(psDroid, NULL, 0);
|
||||||
|
psDroid->psTarStats = NULL;
|
||||||
|
|
||||||
/* Notify scripts we just finished building a structure, pass builder and what was built */
|
/* Notify scripts we just finished building a structure, pass builder and what was built */
|
||||||
psScrCBNewStruct = psStruct;
|
psScrCBNewStruct = psStruct;
|
||||||
|
@ -1212,6 +1213,9 @@ void structureBuild(STRUCTURE *psStruct, DROID *psDroid, int buildPoints)
|
||||||
|
|
||||||
audio_StopObjTrack( psDroid, ID_SOUND_CONSTRUCTION_LOOP );
|
audio_StopObjTrack( psDroid, ID_SOUND_CONSTRUCTION_LOOP );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Not needed, but left for backward compatibility */
|
||||||
|
structureCompletedCallback(psStruct->pStructureType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue