bugBattle for Wesnoth - Bugs: bug #21264, Loading a turnsave in campaign...

 
 
Show feedback again

bug #21264: Loading a turnsave in campaign sets negative gold to 0

Submitted by:  None
Submitted on:  Fri 08 Nov 2013 01:48:17 PM UTC  
 
Category: BugSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Campaign
Status: FixedPrivacy: Public
Assigned to: Anja K <ayne>Originator Email: -unavailable-
Open/Closed: ClosedRelease: 1.11.6
Operating System: Mac OS

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 15 Nov 2013 05:52:52 PM UTC, comment #2:

Fixed by b9fea39efe1e

Anja K <ayne>
Project MemberIn charge of this item.
Sat 09 Nov 2013 04:57:06 AM UTC, comment #1:

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 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.

Matthias Schoeck <mattsc>
Project Member
Fri 08 Nov 2013 01:48:17 PM UTC, original submission:

Loading a turnsave sets negative gold to 0 while it works fine with positive gold. (HttT, Crossroads - but unlikely to be specific to the scenario)

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by ayne (Posted a comment)
  • -unavailable- added by mattsc (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 17 Nov 2013 06:27:28 PM UTCshadowmasterOpen/ClosedOpen=>Closed
    Fri 15 Nov 2013 05:52:52 PM UTCayneStatusNone=>Fixed
    Mon 11 Nov 2013 09:57:15 PM UTCmattscAssigned toNone=>ayne
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup