on_event causes blank lines in console
Moderator: Forum Moderators
on_event causes blank lines in console
This seems odd, but overriding the on_event in lua causes a bunch of blank lines to be printed every time a hex is highlighted by the mouse (Wesnoth 1.12.4 and Mac 10.10.4). Any idea on what is causing it?
Just by using that, not even printing anything, I see a lot of blank lines in the console. Commenting this out stops the issue.
Code: Select all
---[[
-- For debugging:
local old_on_event = wesnoth.game_events.on_event
function wesnoth.game_events.on_event(name)
--print("On event fired:",name)
if old_on_event ~= nil then
old_on_event(name)
end
return {}
end
--]]
Running Wesnoth 1.12.4 on Mac OSX 10.10
Campaigns:
Campaigns:
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: on_event causes blank lines in console
I don't see anything in your code that should obviously cause that. However, you can try by removing thearobinson wrote:overriding the on_event in lua causes a bunch of blank lines to be printed every time a hex is highlighted by the mouse (Wesnoth 1.12.4 and Mac 10.10.4). Any idea on what is causing it?
return {}
line, since functions without a return statement automatically return nil anyway.Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: on_event causes blank lines in console
I tried returning nil and returning the value from the original on_event handler, but still got the blank lines. Just the presence of a custom handler seems to cause the blank lines on mouse movement. Seems odd, but that is what I seem to be experiencing.Elvish_Hunter wrote:I don't see anything in your code that should obviously cause that. However, you can try by removing thearobinson wrote:overriding the on_event in lua causes a bunch of blank lines to be printed every time a hex is highlighted by the mouse (Wesnoth 1.12.4 and Mac 10.10.4). Any idea on what is causing it?return {}
line, since functions without a return statement automatically return nil anyway.
Running Wesnoth 1.12.4 on Mac OSX 10.10
Campaigns:
Campaigns: