Issue542

Title LUA: have_item() should be logical, not numeric
Priority important Status rejected
Assigned To Keywords
Linked issues Watchers

Submitted on 2011-11-21 20h59 by matthiaskrgr, last changed by salimiles.

Files
File name Uploaded Type Edit Remove
patch.patch matthiaskrgr, 2011-11-21.20:59:48 text/x-diff
Messages
Author: matthiaskrgr Date: 2011-11-21   20h59
The attached patch will always return "works" (true) for the first   EveryTime
LuaCode check, regardless of if I have the "!" item or not.

I noticed this bug while checking for "The Super Exterminator!!!" which didn't
work properly.

 r5183

Attached patch.patch.
Author: salimiles Date: 2011-11-21   23h39
In Lua the number 0 does not equal nil or false. See
http://www.lua.org/manual/5.1/manual.html#2.5.3 

So not a bug.
Author: matthiaskrgr Date: 2011-11-22   13h24
Indeed, thanks for pointing out!
Author: salimiles Date: 2011-11-22   19h29
Well since it affects a number of dialogs, a version of this should included in
0.15.

So renaming/reactivating, with a possible patch: http://rb.freedroid.org/r/1644/

See you guys after Thanksgiving!
History
Date User Action Args
2011-11-22 19:29:52salimilessetpriority: bug -> important
messages: + msg2067
title: LUA: item names containing "!" always return true on check if we have it? -> LUA: have_item() should be logical, not numeric
2011-11-22 13:24:06matthiaskrgrsetmessages: + msg2064
2011-11-21 23:39:47salimilessetstatus: open -> rejected
messages: + msg2062
2011-11-21 20:59:49matthiaskrgrcreate