-
Notifications
You must be signed in to change notification settings - Fork 89
bugfix(specialpower): Fix availability of building based special powers #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,17 @@ SpecialPowerModule::~SpecialPowerModule() | |
//------------------------------------------------------------------------------------------------- | ||
void SpecialPowerModule::resolveSpecialPower( void ) | ||
{ | ||
#if !RETAIL_COMPATIBLE_CRC | ||
// TheSuperHackers @info some building based special powers are immediately available | ||
// This means we need to set their available frame to the current frame to make them usable | ||
// The check for a public timer excludes super weapons from the selection criteria | ||
if (getSpecialPowerModuleData()->m_specialPowerTemplate->hasPublicTimer() == FALSE && | ||
getObject()->isKindOf(KINDOF_STRUCTURE) ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if a Mod creates this kind of setup on something that is not a structure? Is the KINDOF_STRUCTURE test really necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Infantry don't seem to be affected by this issue, but that could also be because their special powers have been setup in a different way that initialises their special power timer on unit creation. I still need to double check some powers to make sure they are working still. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am worried that it could break a Mod with a setup that is not anticipating here. Is testing for just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure yet, i would need to test first, but it was only building based powers that were not working when i did initially check. Will do some more testing tomorrow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
so normal unit creation works down this path // if we're pre-built, start counting down
if( !getObject()->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) )
{
//A sharedNSync special only startPowerRecharges when first scienced or when executed,
//Since a new modue with same SPTemplates may construct at any time.
if ( getSpecialPowerTemplate()->isSharedNSync() == FALSE )
startPowerRecharge();
} if a unit has an ability that is instantly available, the reload time being set to zero makes it always available. If i removed the building check in the code it would actually cause all powers to be instantly available. When setting breakpoints the only times i see this code get entered is when the above code is not hit. Usually when a building is placed. i think the reason for this is because a lot of these borken powers use the |
||
{ | ||
m_availableOnFrame = TheGameLogic->getFrame(); | ||
} | ||
#endif | ||
|
||
/* | ||
// if we're pre-built, and not from a command center, and a building register us with the UI | ||
|
Uh oh!
There was an error while loading. Please reload this page.