URL:
  <http://gna.org/bugs/?20160>

                 Summary: [heal_unit] resets health to nearly zero
                 Project: Battle for Wesnoth
            Submitted by: None
            Submitted on: Mo 10 Sep 2012 23:23:43 UTC
                Category: Bug
                Severity: 4 - Important
                Priority: 5 - Normal
              Item Group:  None of the others
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: [email protected]
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.10 - 1.11
        Operating System: Linux

    _______________________________________________________

Details:

Bugfix:
in src/game_events.cpp
in WML_HANDLER_FUNCTION(heal_unit, event_info, cfg)
2614c2614 (trunk Revision 55279)
<                       const int new_hitpoints = std::max(1,
std::min(u->max_hitpoints(), u->hitpoints() + heal_amount));
---
>                       const int& new_hitpoints = std::max(1,
std::min(u->max_hitpoints(), u->hitpoints() + heal_amount));


When [heal_unit] is called at full health, health is set to nearly zero.

I can reproduce the error with the official debian packages 1.10.3-1 and
1.10.3-2 and self compiled 1.10.4,
doesn't seem to occur in the windows version.

Fast way to reproduce it here:
In "Legends of the Invinicibles" Part 2, first scenario let
Efraim attack Umbra with the sword (which calls heal_unit due to its "leeches"
ability)
Bugfix seems to work well...


Operating system:
$uname -sormv
Linux 3.2.0-3-amd64 #1 SMP Mon Jul 23 02:45:17 UTC 2012 x86_64 GNU/Linux

$lsb_release -a
LSB Version:   
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:cxx-3.0-amd64:cxx-3.0-noarch:cxx-3.1-amd64:cxx-3.1-noarch:cxx-3.2-amd64:cxx-3.2-noarch:cxx-4.0-amd64:cxx-4.0-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch:desktop-4.0-amd64:desktop-4.0-noarch:desktop-4.1-amd64:desktop-4.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch:graphics-4.1-amd64:graphics-4.1-noarch:languages-3.2-amd64:languages-3.2-noarch:languages-4.0-amd64:languages-4.0-noarch:languages-4.1-amd64:languages-4.1-noarch:multimedia-3.2-amd64:multimedia-3.2-noarch:multimedia-4.0-amd64:multimedia-4.0-noarch:multimedia-4.1-amd64:multimedia-4.1-noarch:printing-3.2-amd64:printing-3.2-noarch:printing-4.0-amd64:printing-4.0-noarch:printing-4.1-amd64:printing-4.1-noarch:qt4-3.1-amd64:qt4-3.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Debian
Description:    Debian GNU/Linux testing (wheezy)
Release:        testing
Codename:       wheezy

tested compiler version:
$gcc --version
gcc (Debian 4.7.1-7) 4.7.1





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht gesendet von/durch Gna!
  http://gna.org/


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

Reply via email to