URL:
<http://gna.org/bugs/?18795>
Summary: Lua function wesnoth.simulate_combat() returns -nan
values
Project: Battle for Wesnoth
Submitted by: elvish_hunter
Submitted on: sab 08 ott 2011 08:24:16 GMT
Category: Bug
Severity: 4 - Important
Priority: 5 - Normal
Item Group: None of the others
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.9.9+svn
Operating System: Linux
_______________________________________________________
Details:
In 1.9.9+svn, 51392M, when playing After the Storm 0.4.3, in The Triad part 3
[harm_unit] is used twice upon Galas. The second time that it is, a very low
negative number is floated upon him. Since this is not supposed to happen, I
placed this debug code before wml_actions.harm_unit:
function dump(t)
for k, v in pairs(t) do
print (k,v)
if type(v) == "table" then
dump(v)
end
end
end
and inside:
print(amount)
dump(att_stats)
dump(def_stats)
wml_actions.inspect {}
When [harm_unit] is first invoked, everything is fine; but the second time,
dump() returns this in the terminal:
1 -- that is the amount= value
slowed 0
hp_chance table: 0x10471d10
1 1
0 0
poisoned 0
average_hp 1
slowed 0
hp_chance table: 0xb6f8cc8
1 -nan
2 -nan
3 -nan
4 -nan
5 -nan
6 -nan
7 -nan
8 -nan
9 -nan
10 -nan
11 -nan
12 -nan
13 -nan
14 -nan
15 -nan
16 -nan
17 -nan
18 -nan
19 -nan
20 -nan
21 -nan
22 -nan
23 -nan
24 -nan
25 -nan
26 -nan
27 -nan
28 -nan
29 -nan
30 -nan
31 -nan
32 -nan
33 -nan
34 -nan
35 -nan
36 -nan
37 -nan
38 -nan
39 -nan
40 -nan
41 -nan
42 -nan
43 -nan
44 -nan
45 -nan
46 -nan
47 -nan
48 -nan
49 -nan
50 -nan
51 -nan
52 -nan
53 -nan
54 -nan
55 -nan
56 -nan
57 -nan
58 -nan
59 -nan
60 -nan
61 -nan
62 -nan
63 -nan
64 -nan
65 -nan
0 1
poisoned 0
average_hp -nan
The bug is that wesnoth.simulate_combat, under certain conditions, returns
*-nan*, that is not a valid WML or Lua value, but a C++ only value. Since I
have a savegame that always triggers this bug, I'm attaching it.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: sab 08 ott 2011 08:24:16 GMT Name:
AtS-1-The_Triad_—_Part_3_Turno_16.gz Size: 96kB By: elvish_hunter
<http://gna.org/bugs/download.php?file_id=14214>
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?18795>
_______________________________________________
Messaggio inviato con/da Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs