diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h index 1a8ebf6591b..5d3903d8ac2 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h @@ -214,6 +214,7 @@ class SupplyTruckAIUpdate : public AIUpdateInterface, public SupplyTruckAIInterf virtual UnsignedInt getActionDelayForDock( Object *dock ) override; virtual UpdateSleepTime update() override; + virtual void aiDoCommand(const AICommandParms* parms) override; protected: diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index bf77558102c..de3fa8dc5a1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -235,6 +235,9 @@ class ChinookTakeoffOrLandingState : public State { // A chinook given transport duty loses his supplies. while( ai->loseOneBox() ); +#if !RETAIL_COMPATIBLE_CRC + ai->setForceWantingState(FALSE); +#endif } // kill any drift... diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp index 9d544810cfa..5c773f45fae 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp @@ -238,6 +238,18 @@ Real SupplyTruckAIUpdate::getWarehouseScanDistance() const return getSupplyTruckAIUpdateModuleData()->m_warehouseScanDistance; } +void SupplyTruckAIUpdate::aiDoCommand(const AICommandParms* parms) +{ +#if !RETAIL_COMPATIBLE_CRC + if (parms->m_cmdSource == CMD_FROM_PLAYER) + { + setForceWantingState(FALSE); + } +#endif + + AIUpdateInterface::aiDoCommand(parms); +} + // ------------------------------------------------------------------------------------------------ /** CRC */ // ------------------------------------------------------------------------------------------------ diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index c6798af48f3..4b4445d715a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -396,6 +396,9 @@ Object *WorkerAIUpdate::construct( const ThingTemplate *what, // leave the supply truck state and now behave like a dozer. exitingSupplyTruckState(); +#if !RETAIL_COMPATIBLE_CRC + setForceWantingState(FALSE); +#endif // take the required money away from the player if( isRebuild == FALSE ) @@ -673,6 +676,9 @@ void WorkerAIUpdate::newTask( DozerTask task, Object* target ) getObject()->getAIUpdateInterface()->aiIdle(CMD_FROM_AI); } m_workerMachine->setState( AS_DOZER ); +#if !RETAIL_COMPATIBLE_CRC + setForceWantingState(FALSE); +#endif // To clarify, I leave supply truck mode when I notice I am doing something not supply // truck related. When given a construct command, I wait to do anything until I notice // I'm not busy. Both states are being polite, so I must force the switch. @@ -1037,7 +1043,12 @@ void WorkerAIUpdate::aiDoCommand(const AICommandParms* parms) // when a player issues commands, this will cause the dozer to re-evaluate what it's doing if( parms->m_cmdSource == CMD_FROM_PLAYER ) + { m_dozerMachine->resetToDefaultState(); +#if !RETAIL_COMPATIBLE_CRC + setForceWantingState(FALSE); +#endif + } break; } diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h index 10b178c045d..9aa545c5de4 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyTruckAIUpdate.h @@ -219,6 +219,7 @@ class SupplyTruckAIUpdate : public AIUpdateInterface, public SupplyTruckAIInterf virtual Int getUpgradedSupplyBoost() const override { return 0; } virtual UpdateSleepTime update() override; + virtual void aiDoCommand(const AICommandParms* parms) override; protected: diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 917ba12853a..9a168dfa54b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -234,6 +234,9 @@ class ChinookTakeoffOrLandingState : public State { // A chinook given transport duty loses his supplies. while( ai->loseOneBox() ); +#if !RETAIL_COMPATIBLE_CRC + ai->setForceWantingState(FALSE); +#endif } // kill any drift... diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp index 5e966094ef7..9c1d3a8ec04 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp @@ -244,6 +244,18 @@ Real SupplyTruckAIUpdate::getWarehouseScanDistance() const return getSupplyTruckAIUpdateModuleData()->m_warehouseScanDistance; } +void SupplyTruckAIUpdate::aiDoCommand(const AICommandParms* parms) +{ +#if !RETAIL_COMPATIBLE_CRC + if (parms->m_cmdSource == CMD_FROM_PLAYER) + { + setForceWantingState(FALSE); + } +#endif + + AIUpdateInterface::aiDoCommand(parms); +} + // ------------------------------------------------------------------------------------------------ /** CRC */ // ------------------------------------------------------------------------------------------------ diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index ba7313535c5..16f64fd5edf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -396,6 +396,9 @@ Object *WorkerAIUpdate::construct( const ThingTemplate *what, // leave the supply truck state and now behave like a dozer. exitingSupplyTruckState(); +#if !RETAIL_COMPATIBLE_CRC + setForceWantingState(FALSE); +#endif // take the required money away from the player if( isRebuild == FALSE ) @@ -673,6 +676,9 @@ void WorkerAIUpdate::newTask( DozerTask task, Object* target ) getObject()->getAIUpdateInterface()->aiIdle(CMD_FROM_AI); } m_workerMachine->setState( AS_DOZER ); +#if !RETAIL_COMPATIBLE_CRC + setForceWantingState(FALSE); +#endif // To clarify, I leave supply truck mode when I notice I am doing something not supply // truck related. When given a construct command, I wait to do anything until I notice // I'm not busy. Both states are being polite, so I must force the switch. @@ -1037,7 +1043,12 @@ void WorkerAIUpdate::aiDoCommand(const AICommandParms* parms) // when a player issues commands, this will cause the dozer to re-evaluate what it's doing if( parms->m_cmdSource == CMD_FROM_PLAYER ) + { m_dozerMachine->resetToDefaultState(); +#if !RETAIL_COMPATIBLE_CRC + setForceWantingState(FALSE); +#endif + } break; }