bugBattle for Wesnoth - Bugs: bug #20853, In scenarios, if a side starts...

 
 
Show feedback again

bug #20853: In scenarios, if a side starts with gold=0 it is 100

Submitted by:  None
Submitted on:  Tue 28 May 2013 03:49:15 PM UTC  
 
Category: BugSeverity: 5 - Blocker
Priority: 5 - NormalItem Group: WML
Status: FixedPrivacy: Public
Assigned to: Anja K <ayne>Originator Email: -unavailable-
Open/Closed: ClosedRelease: 1.11.4
Operating System: Windows 7

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Sun 02 Jun 2013 05:04:01 PM UTC, comment #13:

I just committed the fix to GitHub. If you're getting compiling Wesnoth yourself you can just pull the updated file from there.
Negative gold in savegames worked in my tests as well.

Anja K <ayne>
Project MemberIn charge of this item.
Sun 02 Jun 2013 06:22:34 AM UTC, comment #12:

After posting the bug, and you've seemed to have fixed it (cool!), could someone be so kind to explain how I apply the patch?

I have been looking allmost everywhere, but I just can't find where the nessesary lines need to be inserted (or where the gold default is set anyway).

Thank you!

By the way, have you tested the behavior of minus gold in savegames? (prepatch minus gold is set to 100 if you load)

Anonymous
Sun 02 Jun 2013 05:44:46 AM UTC, comment #11:

Hm, it seems I messed up my testing completely and posted something untrue yesterday. Let me try this again...

1.10

  • gold=abc (invalid number) -> sticks to 0 gold.
  • gold=0 -> sticks to 0 gold.
  • gold= (empty string) -> defaults to 100 gold.
  • gold attribute missing -> defaults to 100 gold.

Git master with file #18040 applied

  • gold=abc (invalid number ) -> sticks to 0 gold.
  • gold=0 -> sticks to 0 gold.
  • gold= (empty string) -> sticks to 0 gold.
  • gold attribute missing -> defaults to 100 gold.

So the only remaining mismatched behavior would be the handling of the empty string on master.

Ignacio R. Morelle <shadowmaster>
Project Administrator
Sun 02 Jun 2013 05:13:31 AM UTC, comment #10:

It should only set the default when the gold attribute is missing, not when it's explicitly set to 0. It worked that way when I tested it, could you give me an example where it didn't work for you?
I'm not sure what will happen if gold= is set to the empty string, I will have to check that later.

Anja K <ayne>
Project MemberIn charge of this item.
Sat 01 Jun 2013 11:59:34 AM UTC, comment #9:

The patch fixes both bugs.

Unfortunately, it also affects the case where the scenario designer has explicitly set gold=0 for a side in the scenario WML. On 1.10.x and 1.11.0 through 1.11.2 this was handled as one would expect -- the default of 100 was only set when the gold= attribute was missing or set to the empty string.

Of course, with this patch it is possible again to just set a side's gold to zero on a prestart event using the [modify_side] action and not have it reset to 100 after reloading from a saved game, but if the former behavior I mentioned above could be restored that would be nice.

Ignacio R. Morelle <shadowmaster>
Project Administrator
Sat 01 Jun 2013 10:28:44 AM UTC, comment #8:

I attached a patch that fixes bug #20734 without causing this one. Could you please confirm that everything works as expected?

(file #18040)

Anja K <ayne>
Project MemberIn charge of this item.
Sat 01 Jun 2013 08:54:37 AM UTC, comment #7:

Confirmed that reverting commit 0d2eeeeeefaa8fa87d2861d0ed1011574fda5495 "Adding default starting gold to team creation" by Ayne eliminates this bug. The commit in question fixes bug #20734.

Assigning to Ayne.

Ignacio R. Morelle <shadowmaster>
Project Administrator
Fri 31 May 2013 09:42:23 PM UTC, comment #6:

Confirmed the last point about mid-scenario saved-games on git master as of this writing. This can seriously break campaign balance, so I am promoting it to blocker.

Ignacio R. Morelle <shadowmaster>
Project Administrator
Fri 31 May 2013 03:18:11 PM UTC, comment #5:

Just wanted to note, it also happens in savegames. If a side has 0 or minus gold, it is reseted to 100 goldpieces as soon as you load the game.

Anonymous
Wed 29 May 2013 08:49:24 PM UTC, comment #4:

This was just some help for a developer trying to fix this bug.
Not directed at you and nothing you need to understand.

Anonymissimus <anonymissimus>
Project Member
Tue 28 May 2013 10:23:50 PM UTC, comment #3:

Sorry, Anonymissimus I didn't understand a word you said :-\

Especially the part with the seemingly random numbers (do you mean a file in the cache folder? -don't have one with these numbers)

Thx!
Davus

Anonymous
Tue 28 May 2013 06:37:38 PM UTC, comment #2:

wrong commit hash...

1.11.2-288-g0d2eeee

Anonymissimus <anonymissimus>
Project Member
Tue 28 May 2013 06:36:01 PM UTC, comment #1:

Perhaps it was introduced by commit by0d2eeeeeefaa8fa87d2861d0ed1011574fda5495
as I didn't notice it in my campaign recently (about 08.04.2013, with probably a recent trunk built) but now I do.

Anonymissimus <anonymissimus>
Project Member
Tue 28 May 2013 03:49:15 PM UTC, original submission:

Hi folks!
Found a bug in release 1.11.4 . Haven't found it reported, so here I go:

Acrose all scenarios if a side starts with gold=0 in the side tab, it is set to 100 in the game. It mixes up some Ai behavior, insofar that he recrutes even if he shouldn't yet do so, because of scenario setting. (Bug doesn't happen in 1.10.6)

Because this happens in all scenarios, I think it has to do something with the more deeper levels of programming (with which I have no clue).

If anybody has a quickfix other than setting gold=1 in the scenario side tab, I'd be happy to hear.

Excuse my english,
Davus

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #18040:  default_gold.patch added by ayne (750B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ayne (Updated the item)
  • -unavailable- added by shadowmaster (Posted a comment)
  • -unavailable- added by anonymissimus (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 27 Jun 2013 10:04:46 AM UTCshadowmasterOpen/ClosedOpen=>Closed
    Sun 02 Jun 2013 05:04:01 PM UTCayneStatusNone=>Fixed
    Sat 01 Jun 2013 10:28:44 AM UTCayneAttached File-=>Added default_gold.patch, #18040
    Sat 01 Jun 2013 08:54:37 AM UTCshadowmasterAssigned toNone=>ayne
    Fri 31 May 2013 09:42:23 PM UTCshadowmasterSeverity3 - Normal=>5 - Blocker
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup