The .xml logic is fine, and that's why I mentioned that it
should work as designed. My point is that nutrition is persisting after death in the player save file. Here's a recent test:
I created a new character on a server with the current nutrition system in place, and then ran a hexdump on the .ttp file:
Code:
hexdump -C <SteamID>.ttp | grep nutrition
000002f0 6e 75 74 72 69 74 69 6f 6e 00 45 47 72 61 70 68 |nutrition.EGraph|
00000360 00 ff ff ff ff 09 6e 75 74 72 69 74 69 6f 6e 00 |......nutrition.|
As expected nutrition is saved as a variable. Then I edited the buffs.xml removing ALL references to the nutrition system. I restarted the game server, logged the same character in, killed him. respawned and logged out. Checking the same player save file:
Code:
hexdump -C <SteamID>.ttp | grep nutrition
000005b0 09 6e 75 74 72 69 74 69 6f 6e 01 00 00 00 00 00 |.nutrition......|
So, a nutrition value appears to be saved in the player's save file forever, despite the fact that
all references to nutrition were removed from buffs.xml. As a control test, I deleted the player save file and logged back in (with the no-nutrition version of buffs.xml). The new player save file had no reference to 'nutrition' at all.
Taking all this into consideration, I'm playing around with the 'initvars' buff (triggers on respawn after death) to see if adding a setvar 0 for nutrition, malnutrition and scratch will help. If not, IMO the whole nutrition/scratch system might not be salvageable.