Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Make protected calls to isDown() functions. #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

funnydog
Copy link

@funnydog funnydog commented Jun 9, 2019

Since Love 0.11 love.keyboard.isDown() and love.mouse.isDown()
raise exceptions in case of key mismatch.

The current code relies on the old behaviour where no error was signaled
and the function simply returned false.

Protect those calls with pcall() to check if an exception is raised when
the aforementioned functions are called.

The change is backward compatible with older versions of Love.

Since Love 0.11 love.keyboard.isDown() and love.mouse.isDown()
raise exceptions in case of key mismatch.

The current code relies on the old behaviour where no error was signaled
and the function simply returned false.

Protect those calls with pcall() to check if an exception is raised when
the aforementioned functions are called.

The change is backward compatible with older versions of Love.
@mc-lep
Copy link

mc-lep commented Jul 26, 2019

I've modified by source code with your commit and it work perfectly, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants