-
Notifications
You must be signed in to change notification settings - Fork 36
MC_POST_CYCLE_RATE_CALCULATE #486
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
MC_POST_CYCLE_RATE_CALCULATE #486
Conversation
- MC_POST_CYCLE_RATE_CALCULATE Also added previous additions to the Changelog
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.
Old forgotten PR got dropped into my inbox mysteriously
I left some comments, though you would need to sync/rebase the branch with main and test it again. The sig could be broken, too.
I have no big concerns with this, though it is certainly niche, and the fact that it got left for this long with nobody looking for something like this could be a testament to that. But if you still care enough to update & test this, we could probably still add it.
We could also consider making the cycle rate a pseudo-field of some kind via EntityPlus, depending on what you might prefer.
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.
Remove unrelated changelog additions from this PR (if they are still missing from the changelog at head, feel free to just push them directly, though idk with how old this PR is). I guess even the changelog for MC_POST_CYCLE_RATE_CALCULATE will need to be moved. Or omit the changelog from the PR entirely and push something in afterwards.
| ModCallbacks.MC_PRE_NEW_ROOM = 1200 | ||
| ModCallbacks.MC_PRE_MEGA_SATAN_ENDING = 1201 | ||
| ModCallbacks.MC_POST_MODS_LOADED = 1210 | ||
| ModCallbacks.MC_POST_CYCLE_RATE_CALCULATE = 1211 |
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.
No action needed, just noting that this ID is still available
| } | ||
|
|
||
| void ASMPatchPostCycleRateCalculate() { | ||
| SigScan scanner("837f??0075??c787????????00000000"); |
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.
Update to new signature standard (ASM.zhl)
| lua_rawgeti(L, LUA_REGISTRYINDEX, g_LuaEngine->runCallbackRegistry->key); | ||
|
|
||
| lua::LuaResults failure = lua::LuaCaller(L).push(callbackid) | ||
| .push(collectible->_cycleCollectibleCount) |
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.
nit: fix indentation
| PreBirthPatch(immaculateAddr, false); // Immaculate | ||
| } | ||
|
|
||
| // MC_POST_CYCLE_RATE_CALCULATE(1211) |
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.
Just for ref, does this run one every update, or only each time the item "cycles"? Does the timer need to land exactly on the cycle rate, or does the internal code do a >(=) check (mostly just considering the possibility of changing the rate causing it to get stuck permanently. I have not looked at the vanilla code)
Also, does this ONLY run when the pickup is actually a cycling collectible?
|
Since:
I think it makes more sense to close this and revisit the idea later, if it’s still needed. |
Also added previous additions to the Changelog