Follow-up Comment #1, bug #21264 (project wesnoth):

I have confirmed with two other mainline campaigns that this happens
reproducibly, but only for Scenarios 2 and higher.  The reason why it does not
happen for S1 is that it is related to carryover code, which is not entered
for S1 of a campaign.

The error can be replicated by going into any second (or higher) scenario of a
campaign, setting the gold to a negative value in debug mode, saving and
reloading.

When reloading, it is the condition at line 121 here
<https://github.com/wesnoth/wesnoth-old/blob/master/src/gamestatus.cpp#L121>
that sets the gold to zero.  gold_ is 0 and cfg_gold is whatever negative
value is in the save, thus 0 gets stored into the side config.

Now, I do not know this part of the code well enough to say whether a simple
"if this isn't the first turn" conditional is the right thing to do here or
whether the root problem is upstream, but maybe somebody else does.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?21264>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to