Skip to content

Commit a603b5e

Browse files
committed
fix(nonretail): set building based special powers available frame to the current frame to make them immediately available
1 parent 354ef18 commit a603b5e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ SpecialPowerModule::~SpecialPowerModule()
166166
//-------------------------------------------------------------------------------------------------
167167
void SpecialPowerModule::resolveSpecialPower( void )
168168
{
169+
#if !RETAIL_COMPATIBLE_CRC
170+
// TheSuperHackers @info some building based special powers are immediately available
171+
// This means we need to set their available frame to the current frame to make them usable
172+
// The check for a public timer excludes super weapons from the selection criteria
173+
if (getSpecialPowerModuleData()->m_specialPowerTemplate->hasPublicTimer() == FALSE &&
174+
getObject()->isKindOf(KINDOF_STRUCTURE) )
175+
{
176+
m_availableOnFrame = TheGameLogic->getFrame();
177+
}
178+
#endif
179+
169180
/*
170181
171182
// if we're pre-built, and not from a command center, and a building register us with the UI

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ void SpecialPowerModule::setReadyFrame( UnsignedInt frame )
178178
//-------------------------------------------------------------------------------------------------
179179
void SpecialPowerModule::resolveSpecialPower( void )
180180
{
181+
#if !RETAIL_COMPATIBLE_CRC
182+
// TheSuperHackers @info some building based special powers are immediately available
183+
// This means we need to set their available frame to the current frame to make them usable
184+
// The check for a public timer excludes super weapons from the selection criteria
185+
if (getSpecialPowerModuleData()->m_specialPowerTemplate->hasPublicTimer() == FALSE &&
186+
getObject()->isKindOf(KINDOF_STRUCTURE) )
187+
{
188+
m_availableOnFrame = TheGameLogic->getFrame();
189+
}
190+
#endif
191+
181192
/*
182193
183194
// if we're pre-built, and not from a command center, and a building register us with the UI

0 commit comments

Comments
 (0)