This makes the upgrade be acquired or lost through the SetPlayerData function (via "HasUpgrade"), and the UpgradeLost function now works properly, reversing the upgrade's modifiers accordingly.
Example of how this would be used through Lua:
SetPlayerData(0, "HasUpgrade", "upgrade-dwarven-broad-axe", true) -- makes player 0 acquire the dwarven broad axe upgrade
Improved version of this code, as discussed in the Stratagus conference:
https:/ /dl.dropboxuser content. com/u/1732902/ Wyrmsun/ Stratagus% 20Patch/ script_ player. cpp /dl.dropboxuser content. com/u/1732902/ Wyrmsun/ Stratagus% 20Patch/ upgrade. cpp
https:/
This makes the upgrade be acquired or lost through the SetPlayerData function (via "HasUpgrade"), and the UpgradeLost function now works properly, reversing the upgrade's modifiers accordingly.
Example of how this would be used through Lua: dwarven- broad-axe" , true) -- makes player 0 acquire the dwarven broad axe upgrade
SetPlayerData(0, "HasUpgrade", "upgrade-