Follow-up Comment #3, patch #1120 (project wesnoth):
The Lua code can now iterate over all the units and query attributes. The
test scenario exercises it by counting the number of units on each side:
local units = wesnoth.get_units()
for dummy,unit in pairs(units) do
if unit.side == 1
then side1 = side1 + 1
else side2 = side2 + 1
end
end
(file #5232, file #5233)
_______________________________________________________
Additional Item Attachment:
File name: wesnoth-lua.patch Size:10 KB
File name: luatest.cfg Size:1 KB
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1120>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs