From 8b5a764474162a7f1e7bd6122747ae52e4d8ea62 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 4 Aug 2026 01:30:17 +1000 Subject: [PATCH 1/4] feat: Add option to bypass initial upgraded special power reload time --- .../GameLogic/Module/UnpauseSpecialPowerUpgrade.h | 1 + .../Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp | 11 +++++++++++ .../GameLogic/Module/UnpauseSpecialPowerUpgrade.h | 1 + .../Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp | 11 +++++++++++ 4 files changed, 24 insertions(+) diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h index d02631f1372..7273cd0e395 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h @@ -49,6 +49,7 @@ class UnpauseSpecialPowerUpgradeModuleData : public UpgradeModuleData static void buildFieldParse(MultiIniFieldParse& p); const SpecialPowerTemplate *m_specialPower; + Bool m_hasInitialReloadTime; }; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp index 73a0d8f0dee..95047376176 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp @@ -33,6 +33,7 @@ #include "PreRTS.h" #include "Common/SpecialPower.h" #include "Common/Xfer.h" +#include "GameLogic/GameLogic.h" #include "GameLogic/Object.h" #include "GameLogic/Module/SpecialPowerModule.h" #include "GameLogic/Module/UnpauseSpecialPowerUpgrade.h" @@ -42,6 +43,7 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() { m_specialPower = nullptr; + m_hasInitialReloadTime = true; } //------------------------------------------------------------------------------------------------- @@ -53,6 +55,7 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() static const FieldParse dataFieldParse[] = { { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_specialPower ) }, + { "HasInitialReloadTime", INI::parseBool, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_hasInitialReloadTime) }, { nullptr, nullptr, nullptr, 0 } }; p.add(dataFieldParse); @@ -89,7 +92,15 @@ void UnpauseSpecialPowerUpgrade::upgradeImplementation() continue; if( sp->getSpecialPowerTemplate() == getUnpauseSpecialPowerUpgradeModuleData()->m_specialPower ) + { sp->pauseCountdown( FALSE ); + + if (!getUnpauseSpecialPowerUpgradeModuleData()->m_hasInitialReloadTime) + { + UnsignedInt now = TheGameLogic->getFrame(); + sp->setReadyFrame(now); + } + } } } diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h index 60716fabad0..c28d0d99b6e 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h @@ -49,6 +49,7 @@ class UnpauseSpecialPowerUpgradeModuleData : public UpgradeModuleData static void buildFieldParse(MultiIniFieldParse& p); const SpecialPowerTemplate *m_specialPower; + Bool m_hasInitialReloadTime; }; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp index 182e636bc58..4203e126931 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp @@ -33,6 +33,7 @@ #include "PreRTS.h" #include "Common/SpecialPower.h" #include "Common/Xfer.h" +#include "GameLogic/GameLogic.h" #include "GameLogic/Object.h" #include "GameLogic/Module/SpecialPowerModule.h" #include "GameLogic/Module/UnpauseSpecialPowerUpgrade.h" @@ -42,6 +43,7 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() { m_specialPower = nullptr; + m_hasInitialReloadTime = true; } //------------------------------------------------------------------------------------------------- @@ -53,6 +55,7 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() static const FieldParse dataFieldParse[] = { { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_specialPower ) }, + { "HasInitialReloadTime", INI::parseBool, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_hasInitialReloadTime) }, { nullptr, nullptr, nullptr, 0 } }; p.add(dataFieldParse); @@ -89,7 +92,15 @@ void UnpauseSpecialPowerUpgrade::upgradeImplementation() continue; if( sp->getSpecialPowerTemplate() == getUnpauseSpecialPowerUpgradeModuleData()->m_specialPower ) + { sp->pauseCountdown( FALSE ); + + if (!getUnpauseSpecialPowerUpgradeModuleData()->m_hasInitialReloadTime) + { + UnsignedInt now = TheGameLogic->getFrame(); + sp->setReadyFrame(now); + } + } } } From bb74c62493a70fb4da57ef8feefc5e14cd100885 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 4 Aug 2026 18:17:30 +1000 Subject: [PATCH 2/4] tweak: Move field to the SpecialAbility module to allow usage for non-upgrade paths --- .../Include/GameLogic/Module/SpecialPowerModule.h | 3 +++ .../GameLogic/Module/UnpauseSpecialPowerUpgrade.h | 1 - .../Object/SpecialPower/SpecialPowerModule.cpp | 13 ++++++++++++- .../Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp | 4 +--- .../Include/GameLogic/Module/SpecialPowerModule.h | 3 +++ .../GameLogic/Module/UnpauseSpecialPowerUpgrade.h | 1 - .../Object/SpecialPower/SpecialPowerModule.cpp | 13 ++++++++++++- .../Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp | 4 +--- 8 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h index d6e55578b82..5b19dc02d18 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h @@ -66,6 +66,7 @@ class SpecialPowerModuleInterface virtual void markSpecialPowerTriggered( const Coord3D *location ) = 0; virtual void startPowerRecharge() = 0; virtual const AudioEventRTS& getInitiateSound() const = 0; + virtual Bool hasInitialReloadTime() const = 0; virtual Bool isScriptOnly() const = 0; }; @@ -83,6 +84,7 @@ class SpecialPowerModuleData : public BehaviorModuleData AudioEventRTS m_initiateSound; Bool m_updateModuleStartsAttack; ///< update module determines when the special power actually starts! If true, update module is required. Bool m_startsPaused; ///< Paused on creation, someone else will have to unpause (like upgrade module, or script) + Bool m_hasInitialReloadTime; ///< If true, the special power will have a reload time on creation, otherwise it will be ready immediately. Bool m_scriptedSpecialPowerOnly; }; @@ -154,6 +156,7 @@ class SpecialPowerModule : public BehaviorModule, virtual void startPowerRecharge() override; virtual const AudioEventRTS& getInitiateSound() const override; + virtual Bool hasInitialReloadTime() const override; virtual Bool isScriptOnly() const override; protected: diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h index 7273cd0e395..d02631f1372 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h @@ -49,7 +49,6 @@ class UnpauseSpecialPowerUpgradeModuleData : public UpgradeModuleData static void buildFieldParse(MultiIniFieldParse& p); const SpecialPowerTemplate *m_specialPower; - Bool m_hasInitialReloadTime; }; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index 24db1aab346..c0343fe8160 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -63,6 +63,7 @@ SpecialPowerModuleData::SpecialPowerModuleData() m_specialPowerTemplate = nullptr; m_updateModuleStartsAttack = false; m_startsPaused = FALSE; + m_hasInitialReloadTime = TRUE; m_scriptedSpecialPowerOnly = FALSE; } @@ -78,6 +79,7 @@ SpecialPowerModuleData::SpecialPowerModuleData() { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( SpecialPowerModuleData, m_specialPowerTemplate ) }, { "UpdateModuleStartsAttack", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_updateModuleStartsAttack ) }, { "StartsPaused", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_startsPaused ) }, + { "HasInitialReloadTime", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_hasInitialReloadTime ) }, { "InitiateSound", INI::parseAudioEventRTS, nullptr, offsetof( SpecialPowerModuleData, m_initiateSound ) }, { "ScriptedSpecialPowerOnly", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_scriptedSpecialPowerOnly ) }, { nullptr, nullptr, nullptr, 0 } @@ -345,6 +347,12 @@ Real SpecialPowerModule::getPercentReady() const return percent; } +Bool SpecialPowerModule::hasInitialReloadTime() const +{ + const SpecialPowerModuleData* modData = getSpecialPowerModuleData(); + return modData->m_hasInitialReloadTime; +} + //------------------------------------------------------------------------------------------------- // A special power module that is only supposed to be fired via scripts. An example of this // are the various cargo plane units we have. Scripters can launch specials from them after @@ -396,7 +404,10 @@ void SpecialPowerModule::startPowerRecharge() else { // set the frame we will be 100% available on now - m_availableOnFrame = TheGameLogic->getFrame() + getSpecialPowerTemplate()->getReloadTime(); + m_availableOnFrame = TheGameLogic->getFrame(); + + if (hasInitialReloadTime()) + m_availableOnFrame += getSpecialPowerTemplate()->getReloadTime(); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp index 95047376176..e477567f12c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp @@ -43,7 +43,6 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() { m_specialPower = nullptr; - m_hasInitialReloadTime = true; } //------------------------------------------------------------------------------------------------- @@ -55,7 +54,6 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() static const FieldParse dataFieldParse[] = { { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_specialPower ) }, - { "HasInitialReloadTime", INI::parseBool, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_hasInitialReloadTime) }, { nullptr, nullptr, nullptr, 0 } }; p.add(dataFieldParse); @@ -95,7 +93,7 @@ void UnpauseSpecialPowerUpgrade::upgradeImplementation() { sp->pauseCountdown( FALSE ); - if (!getUnpauseSpecialPowerUpgradeModuleData()->m_hasInitialReloadTime) + if (!sp->hasInitialReloadTime()) { UnsignedInt now = TheGameLogic->getFrame(); sp->setReadyFrame(now); diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h index 8e5200007fc..5d7ffdb4264 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h @@ -66,6 +66,7 @@ class SpecialPowerModuleInterface virtual void markSpecialPowerTriggered( const Coord3D *location ) = 0; virtual void startPowerRecharge() = 0; virtual const AudioEventRTS& getInitiateSound() const = 0; + virtual Bool hasInitialReloadTime() const = 0; virtual Bool isScriptOnly() const = 0; //If the special power launches a construction site, we need to know the final product for placement purposes. @@ -86,6 +87,7 @@ class SpecialPowerModuleData : public BehaviorModuleData AudioEventRTS m_initiateSound; Bool m_updateModuleStartsAttack; ///< update module determines when the special power actually starts! If true, update module is required. Bool m_startsPaused; ///< Paused on creation, someone else will have to unpause (like upgrade module, or script) + Bool m_hasInitialReloadTime; ///< If true, the special power will have a reload time on creation, otherwise it will be ready immediately. Bool m_scriptedSpecialPowerOnly; }; @@ -157,6 +159,7 @@ class SpecialPowerModule : public BehaviorModule, virtual void startPowerRecharge() override; virtual const AudioEventRTS& getInitiateSound() const override; + virtual Bool hasInitialReloadTime() const override; virtual Bool isScriptOnly() const override; //If the special power launches a construction site, we need to know the final product for placement purposes. diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h index c28d0d99b6e..60716fabad0 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h @@ -49,7 +49,6 @@ class UnpauseSpecialPowerUpgradeModuleData : public UpgradeModuleData static void buildFieldParse(MultiIniFieldParse& p); const SpecialPowerTemplate *m_specialPower; - Bool m_hasInitialReloadTime; }; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index 6f88eff654d..369f305f916 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -64,6 +64,7 @@ SpecialPowerModuleData::SpecialPowerModuleData() m_specialPowerTemplate = nullptr; m_updateModuleStartsAttack = false; m_startsPaused = FALSE; + m_hasInitialReloadTime = TRUE; m_scriptedSpecialPowerOnly = FALSE; } @@ -79,6 +80,7 @@ SpecialPowerModuleData::SpecialPowerModuleData() { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( SpecialPowerModuleData, m_specialPowerTemplate ) }, { "UpdateModuleStartsAttack", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_updateModuleStartsAttack ) }, { "StartsPaused", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_startsPaused ) }, + { "HasInitialReloadTime", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_hasInitialReloadTime ) }, { "InitiateSound", INI::parseAudioEventRTS, nullptr, offsetof( SpecialPowerModuleData, m_initiateSound ) }, { "ScriptedSpecialPowerOnly", INI::parseBool, nullptr, offsetof( SpecialPowerModuleData, m_scriptedSpecialPowerOnly ) }, { nullptr, nullptr, nullptr, 0 } @@ -370,6 +372,12 @@ Real SpecialPowerModule::getPercentReady() const return percent; } +Bool SpecialPowerModule::hasInitialReloadTime() const +{ + const SpecialPowerModuleData* modData = getSpecialPowerModuleData(); + return modData->m_hasInitialReloadTime; +} + //------------------------------------------------------------------------------------------------- // A special power module that is only supposed to be fired via scripts. An example of this // are the various cargo plane units we have. Scripters can launch specials from them after @@ -421,7 +429,10 @@ void SpecialPowerModule::startPowerRecharge() else { // set the frame we will be 100% available on now - m_availableOnFrame = TheGameLogic->getFrame() + getSpecialPowerTemplate()->getReloadTime(); + m_availableOnFrame = TheGameLogic->getFrame(); + + if (hasInitialReloadTime()) + m_availableOnFrame += getSpecialPowerTemplate()->getReloadTime(); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp index 4203e126931..ff799bc9d95 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp @@ -43,7 +43,6 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() { m_specialPower = nullptr; - m_hasInitialReloadTime = true; } //------------------------------------------------------------------------------------------------- @@ -55,7 +54,6 @@ UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() static const FieldParse dataFieldParse[] = { { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_specialPower ) }, - { "HasInitialReloadTime", INI::parseBool, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_hasInitialReloadTime) }, { nullptr, nullptr, nullptr, 0 } }; p.add(dataFieldParse); @@ -95,7 +93,7 @@ void UnpauseSpecialPowerUpgrade::upgradeImplementation() { sp->pauseCountdown( FALSE ); - if (!getUnpauseSpecialPowerUpgradeModuleData()->m_hasInitialReloadTime) + if (!sp->hasInitialReloadTime()) { UnsignedInt now = TheGameLogic->getFrame(); sp->setReadyFrame(now); From d88b24cc0bd3dea20ba33637c42696f964f2dba3 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 4 Aug 2026 18:22:16 +1000 Subject: [PATCH 3/4] tweak: Prevent potential mismatches between different retail-compatible clients --- .../GameLogic/Object/SpecialPower/SpecialPowerModule.cpp | 4 ++++ .../GameLogic/Object/SpecialPower/SpecialPowerModule.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index c0343fe8160..77b6fa24ca2 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -349,6 +349,10 @@ Real SpecialPowerModule::getPercentReady() const Bool SpecialPowerModule::hasInitialReloadTime() const { +#if RETAIL_COMPATIBLE_CRC + return true; +#endif + const SpecialPowerModuleData* modData = getSpecialPowerModuleData(); return modData->m_hasInitialReloadTime; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index 369f305f916..6398d05475c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -374,6 +374,10 @@ Real SpecialPowerModule::getPercentReady() const Bool SpecialPowerModule::hasInitialReloadTime() const { +#if RETAIL_COMPATIBLE_CRC + return true; +#endif + const SpecialPowerModuleData* modData = getSpecialPowerModuleData(); return modData->m_hasInitialReloadTime; } From 76b87754b8a26885dba229ce741751221185511e Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 4 Aug 2026 18:35:48 +1000 Subject: [PATCH 4/4] tweak: Only ignore the first reload time --- .../GameLogic/Object/SpecialPower/SpecialPowerModule.cpp | 9 +++++---- .../GameLogic/Object/SpecialPower/SpecialPowerModule.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index 77b6fa24ca2..01cf92b600e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -115,7 +115,11 @@ SpecialPowerModule::SpecialPowerModule( Thing *thing, const ModuleData *moduleDa //A sharedNSync special only startPowerRecharges when first scienced or when executed, //Since a new module with same SPTemplates may construct at any time. if ( getSpecialPowerTemplate()->isSharedNSync() == FALSE ) + { startPowerRecharge(); + if (!hasInitialReloadTime()) + m_availableOnFrame = TheGameLogic->getFrame(); + } } // WE USED TO DO THE POLL-EVERYBODY-AND-VOTE-ON-WHO-TO-SYNC-TO THING HERE, // BUT NO MORE, NOW IT IS HANDLED IN PLAYER @@ -408,10 +412,7 @@ void SpecialPowerModule::startPowerRecharge() else { // set the frame we will be 100% available on now - m_availableOnFrame = TheGameLogic->getFrame(); - - if (hasInitialReloadTime()) - m_availableOnFrame += getSpecialPowerTemplate()->getReloadTime(); + m_availableOnFrame = TheGameLogic->getFrame() + getSpecialPowerTemplate()->getReloadTime(); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index 6398d05475c..35d03c85b93 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -116,7 +116,11 @@ SpecialPowerModule::SpecialPowerModule( Thing *thing, const ModuleData *moduleDa //A sharedNSync special only startPowerRecharges when first scienced or when executed, //Since a new module with same SPTemplates may construct at any time. if ( getSpecialPowerTemplate()->isSharedNSync() == FALSE ) + { startPowerRecharge(); + if (!hasInitialReloadTime()) + m_availableOnFrame = TheGameLogic->getFrame(); + } } // WE USED TO DO THE POLL-EVERYBODY-AND-VOTE-ON-WHO-TO-SYNC-TO THING HERE, // BUT NO MORE, NOW IT IS HANDLED IN PLAYER @@ -433,10 +437,7 @@ void SpecialPowerModule::startPowerRecharge() else { // set the frame we will be 100% available on now - m_availableOnFrame = TheGameLogic->getFrame(); - - if (hasInitialReloadTime()) - m_availableOnFrame += getSpecialPowerTemplate()->getReloadTime(); + m_availableOnFrame = TheGameLogic->getFrame() + getSpecialPowerTemplate()->getReloadTime(); } }