Page 2 of 2

Re: Version independent quitting

Posted: Sun Apr 01, 2012 7:18 pm
by bartbes
a_greed wrote:Same problem. I solved it by os.exit(), but I don't think it's the best solution.
It's terrible, you're not letting love clean up.
richapple wrote:Even easier:

Code: Select all

if key == "escape" then
	return love.event.push("quit") or love.event.push("q")
end
You mean, it doesn't do what you think it does?
Robin wrote: My favourite is:

Code: Select all

(love.event.quit or love.event.push) 'q'
That's a nice one, but I'm not someone who likes the no-parentheses single-string-argument call form for (just about) anything other than require.
T-Bone wrote:It is as if LÖVE error aren't caught by pcall properly. Is this perhaps a bug in 0.8.0 or am I doing something wrong?
That is most definitely not a bug, love.event.push simply doesn't cause the error.