- Notifications
You must be signed in to change notification settings - Fork370
Hotfixes
lewri: Hotfix process needs updating now we pre-allocate savegame versions post-release.
Hotfixes should be highly avoided in CorsixTH. However, there may be times where a bug not caught before release has such a significant impact it requires addressing.
- Make sure an issue exists for the bug.
- Discuss with the developers the bug and the impact it will have on playing the game.
- If the bug can be worked around or rarely encountered a hotfix is likely not necessary.
- If the bug was found near the end of a release cycle, can it wait until the release?
- If approved the issue should be marked as
P1 Critical
to denote an urgent fix.
It is important to establish what broke in the code and work the proper solution. Then, check if the hotfix can be applied in the same manner.
Note: Hotfixes do not follow regularSAVEGAME_VERSION
checks and instead should follow their own numbering.
Replacexxx
with the class the hotfix is applied to
ReplaceY
with the hotfix number for the release (starting at 1)
Assign the affected class (e.g.Map:Map()
) with a flag for this hotfix:self.hotfixY = true
Hotfix function (inserted above xxx:afterLoad(old, new))
--! Apply a hotfix to this save.--!param num (int) the hotfix number--!param issue (int) the issue numberfunctionxxx:applyHotfix(num,issue)assert((numandissue),"Hotfix parameters given are undefined!")ifnum==Ythen-- Put hotfix code hereself.hotfixY=truelocalstring="Game successfully patched with hotfix"..num.." (Issue #"..issue..")"self.app.world:gameLog(string)elselocalstring="Hotfix"..num.." not found. The game may result in unexpected behavior."self.app.world:gameLog(string)endend
Add the following toafterLoad(old, new)
--i
is the relevant issue number of github.
-- Comment, if desiredifnotself.hotfixYthenself:applyHotfix(Y,i)end
Remember to adjust the version number inApp:getVersion()
e.g.0.65
to0.65.Y
and finally add an entry tochangelog.txt
.
Once these steps are done, make a Pull Request targeting the current release branch (not master).
Make your fixes on the master branch too as your normally would. However, in yourafterLoad
make sure you delete the hotfix parameter for next release:self.hotfixY = nil
\