Ради вашего удобства наш сайт использует cookies! Узнать больше! Мы используем cookies

Stats NaN Guard

This mod is a workaround for a long standing bug in Project Zomboid where a simple math error (such as division by zero) will propagate and "infect" character stats, ruining the game. The likelihood of this happening is extremely likely, since the developers do not perform any checks for overflows or division by zero anywhere. So, the chances of your character being messed up at any point in time are also extremely likely. Sometimes you can play for several days before it would become apparent that something is not right: your character is no longer regaining endurance or becomes unusually hungry or sleepy. The way how this mod works is that it performs a lightweight check in the onPlayerUpdate event and looks for any stats that turned from a number into NaN (Not a Number). If it finds such a stat, it will use a sane value for that stat to reset it and then will float a halo message on top of the character saying that "Stats NaN infection cured!". The mod will try 3 times and if the curing fails, it will float a red halo message saying that "Stats NaN infection is UNCURABLE!". At that moment, you will know for sure that your character is severely messed up. If you encounter the UNCURABLE state, I would love to work with you to implement a "cure", so the mod would be able to handle it in the future. I only tested this mod on 42.16+, but since the mechanics is supposed to be exactly the same across all Build 42 versions, I decided not to version lock the mod. You can try it on other 42.* and please tell me about the result. This mod should support multiplayer games properly, but I have not tested that. Would appreciate any feedback for folks who are running servers. P.S. I am really surprised that the game developers are not doing anythin about this problem, it was reported against at least 42.14! :( Workshop ID: 3697888147 Mod ID: StatNANGuard