Version independent quitting

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Version independent quitting

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests