URL:
  <http://gna.org/patch/?3270>

                 Summary: Fix for bug #19120
                 Project: Battle for Wesnoth
            Submitted by: None
            Submitted on: Tue 24 Apr 2012 08:56:28 AM UTC
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: [email protected]
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I think this fixes the issues in bug #19120 and also here:

http://forums.wesnoth.org/viewtopic.php?f=6&t=34236
http://forums.wesnoth.org/viewtopic.php?f=4&t=36274

Attached is a save file which demonstrates the bug; if you run  Wesnoth, load
the save file and press s (for Statistics), it will show the following:

Damage
Inflicted 7289/274.8 +2552%
Taken 4784/263.2 +1717%

If you apply the patch, then load the save file, it will show the following:

Damage
Inflicted 7289/7348.9 0%
Taken 4784/4900.8 -2%

The patch uses the to_double() member function instead of lexical_cast<long
long>().  The problem with lexical_cast<long long> is that it does not work
for values >= 1 million, because the value gets converted to exponential
notation.  For example, 1234000 could get converted to 1.234e+06, and
lexical_cast<long long> will use everything up to the decimal point, resulting
in a value of 1.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 24 Apr 2012 08:56:29 AM UTC  Name: statistics.patch  Size: 2kB   By:
None
Save file demonstrating bug; patch to fix bug
<http://gna.org/patch/download.php?file_id=15615>
-------------------------------------------------------
Date: Tue 24 Apr 2012 08:56:28 AM UTC  Name: NR-To_the_Mines.gz  Size: 18kB  
By: None
Save file demonstrating bug; patch to fix bug
<http://gna.org/patch/download.php?file_id=15614>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?3270>

_______________________________________________
  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