-
Notifications
You must be signed in to change notification settings - Fork 117
bugfix(specialpower): Fix Special Power ready state during construction #1461
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?
bugfix(specialpower): Fix Special Power ready state during construction #1461
Conversation
|
I tested this on local player and AI Player and Special Powers worked correctly. @Mauller please check if this solves all the issues that you have seen. |
20617ca to
060b423
Compare
| DEBUG_ASSERTCRASH(m_availableOnFrame == UINT_MAX, | ||
| ("Unexpected state. Function must be called only after OBJECT_STATUS_UNDER_CONSTRUCTION was completed")); | ||
|
|
||
| m_availableOnFrame = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be m_availableOnFrame = TheGameLogic->getFrame(); ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been a long time and I do not remember if this was intentional. I tend to believe it was intentionally 0. We can try TheGameLogic->getFrame() and see if that works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using zero or the current frame at this point should work either way, when init is called it will call initCountdown(); which will set m_availableOnFrame into the future where it needs to be for the countdown to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thing to prevent the bugged behaviour is making sure that the m_availableOnFrame is set into the far future while a building is still under construciton or a unit is not ready yet etc.
This then prevents the exploit that can crash the game.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be enough to just return false with initiateIntentToDoSpecialPower?
|
Well that is not good. What do you do? |
|
So I build 1 complete nuke and 1 scaffold nuke, group them in the same team. Then use a hotkey (like F).
So what I have been doing is not exactly the exploit, but something is still not right |
060b423 to
6e3da22
Compare
|
I do not understand how you are doing this. I cannot add 2 buildings to the same team. I have made additional changes that hopefully fix it while keeping retail compatibility. |
|
It doesn't crash anymore, but now I can launch a nuke from a scaffold. To be able to group buildings, you need to comment out line 1200 and 1217 in Alternatively, here is a replay with pre-grouped buildings. Press 1, click on the fire nuke icon (even when it is not finished) and fire the nuke from scaffold. |
|
I am unable to shoot the missile when 2 silos are selected. I tested with I need a video or step by step guide. |
6e3da22 to
9351133
Compare
|
I have applied more changes, but have lost track of what is going on with RETAIL_COMPATIBLE_CRC. Things look ok with RETAIL_COMPATIBLE_CRC 0, but I could be wrong. Code is very messy as usual, which makes it cumbersome. |
|
With retail compatibility on and off, I can still do this: 2025-11-08.19-36-48.mp4You cannot manually group buildings as we fixed that bug. However with cheat engines there are still ways around it, or just disable the code that prevents it. To help out, I already created a replay that has the buildings grouped. Steps:
|
60b7d98 to
b80c622
Compare
|
Rebased on main. |
I've reinstalled the game from Steam, removed all the Genpatcher stuff and I can still do what I showed in the video. |
|
Ok I wonder where this behavior difference comes from. |


This change is an alternative to #1444 and attempts to fix the Special Power ready state during construction. To do that, it postpones the Special Power initialization until the construction is signaled done.
TODO