From b958d867d38053377c9f5c798661a134993b1bae Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Sun, 16 Nov 2025 22:12:07 +1100 Subject: [PATCH 1/3] bugfix: Invalidate current dozer build task if the target scaffold no longer exists --- .../Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp | 4 ++++ .../GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp | 4 ++++ .../Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp | 4 ++++ .../GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index d5371bd9a31..0617dec83cb 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1599,6 +1599,10 @@ UpdateSleepTime DozerAIUpdate::update( void ) if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; +#if !RETAIL_COMPATIBLE_CRC + else if (currentTask == DOZER_TASK_BUILD && targetObject == NULL) + invalidTask = TRUE; +#endif // cancel the task if it's now invalid if( invalidTask == TRUE ) 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 7b2dfd9eec7..44d11ad4adc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -283,6 +283,10 @@ UpdateSleepTime WorkerAIUpdate::update( void ) if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; +#if !RETAIL_COMPATIBLE_CRC + else if (currentTask == DOZER_TASK_BUILD && targetObject == NULL) + invalidTask = TRUE; +#endif // cancel the task if it's now invalid if( invalidTask == TRUE ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index ea9d64c9a2c..651202dd6bf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1604,6 +1604,10 @@ UpdateSleepTime DozerAIUpdate::update( void ) if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; +#if !RETAIL_COMPATIBLE_CRC + else if (currentTask == DOZER_TASK_BUILD && targetObject == NULL) + invalidTask = TRUE; +#endif // cancel the task if it's now invalid if( invalidTask == TRUE ) 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 a3bdd0628a5..15e1af6b769 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -283,6 +283,10 @@ UpdateSleepTime WorkerAIUpdate::update( void ) if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; +#if !RETAIL_COMPATIBLE_CRC + else if (currentTask == DOZER_TASK_BUILD && targetObject == NULL) + invalidTask = TRUE; +#endif // cancel the task if it's now invalid if( invalidTask == TRUE ) From 7e9268651ff2ac316559c3de7b1a70a37de0ce52 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Mon, 22 Dec 2025 08:34:42 +1100 Subject: [PATCH 2/3] docs: Add comments --- .../Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp | 1 + .../Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index 0617dec83cb..315a62c1db8 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1596,6 +1596,7 @@ UpdateSleepTime DozerAIUpdate::update( void ) Bool invalidTask = FALSE; // validate the task and the target + // TheSuperHackers @bugfix Stubbjax 16/11/2025 Invalidate the task when the build scaffold is destroyed. if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index 651202dd6bf..4065a2ba3b5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1601,6 +1601,7 @@ UpdateSleepTime DozerAIUpdate::update( void ) Bool invalidTask = FALSE; // validate the task and the target + // TheSuperHackers @bugfix Stubbjax 16/11/2025 Invalidate the task when the build scaffold is destroyed. if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; From 7846ddfd438bc7ed79491404978e10fabd5c8c5a Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 31 Dec 2025 15:22:49 +1100 Subject: [PATCH 3/3] docs: Add more comments --- .../Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp | 1 + .../Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp | 1 + 2 files changed, 2 insertions(+) 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 44d11ad4adc..1285a4d618d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -280,6 +280,7 @@ UpdateSleepTime WorkerAIUpdate::update( void ) Bool invalidTask = FALSE; // validate the task and the target + // TheSuperHackers @bugfix Stubbjax 16/11/2025 Invalidate the task when the build scaffold is destroyed. if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE; 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 15e1af6b769..b86af852746 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -280,6 +280,7 @@ UpdateSleepTime WorkerAIUpdate::update( void ) Bool invalidTask = FALSE; // validate the task and the target + // TheSuperHackers @bugfix Stubbjax 16/11/2025 Invalidate the task when the build scaffold is destroyed. if( currentTask == DOZER_TASK_REPAIR && TheActionManager->canRepairObject( getObject(), targetObject, getLastCommandSource() ) == FALSE ) invalidTask = TRUE;