URL:
<http://gna.org/bugs/?16730>
Summary: undefined [defense] shows as 0% def, but equals to
100% for calculations
Project: Battle for Wesnoth
Submitted by: vaxquis
Submitted on: Sunday 09/19/2010 at 16:14
Category: Bug
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: WML
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.9.1 (possibly previous too)
Operating System: any
_______________________________________________________
Details:
let's say we have a unit with undefined deep_water defense. it will show as
defense = 0% in Wesnoth help system (that should correspond to
deep_water=100), but after programatically *increasing* the defense, thus
*decreasing* deep_water (i.e.
[effect]apply_to=defense[defense]deep_water=-10[/defense][/effect]) we
finally get deep_water=-10 instead of expected 90 (resulting in defense going
straight from 0% to 90%).
easy to reproduce, just make an event creating any non-water unit in deep
water, and then apply deep_water=-10 to it. with final deep_water=-10 the
unit will have 90% defense shown.
proposed solutions:
* make a cap on max/min defense values (0-100) after effects, so that it will
remain in the correct range regardless of them,
* make the default (undeclared) defenses equal to 100 (0% def) instead of
current value of 0 (displayed as 0%, as odd as it is),
* handle negative defense values either as an error, or as equal to 0 (100%);
currently -10 => 90% def, -20 => 80% def, so i suppose it takes abs(def) for
the calculations.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?16730>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs