Lua functions not returning a value defaults to true

Create issue
Issue #916 new
Former user created an issue

Automatic migration. Original reporter: "DEvil HUnter"

Lua functions like event-subscriptions should return a boolean value. it is possible to return nothing in lua because it is not checking against it. CEGUI checks whether the returned value is boolean or not but if it is not boolean it defaults to true. true is not a good default value for functions returning something bad or just nothing. it should be false or just null or causing a cegui-error.

Reproducibility: N/A

Additional information: function toggleConsoleVisability(args) --toggle cegui console window visibility local winMgr = CEGUI.WindowManager:getSingleton() local console = winMgr:getWindow("Vanilla/Console")

if CEGUI.toKeyEventArgs(args).scancode == CEGUI.Key.F12 then if console:isVisible() then console:setVisible(false) else console:setVisible(true) end end end

Comments (1)

  1. Former user Account Deleted

    Original reporter: DEvil HUnter

    i hope there is no other place doing something like this i missed

  2. Log in to comment