Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crashes if the player presses enter while running from battle #2

Open
CyborgNinjaJesus opened this issue Dec 20, 2021 · 0 comments

Comments

@CyborgNinjaJesus
Copy link

CyborgNinjaJesus commented Dec 20, 2021

Issue:

The game crashes after running away when the player keeps pressing enter during the transition from the battle state to the play state.

Repro:

1 Start game
2 Dismiss introduction message
3 Go to the tall grass and start a fight
4 Select Run from the battle menu
5 Keep pressing enter while the transition is happening
6 Crash: Error

src/states/StateStack.lua:16: attempt to index a nil value

Traceback

src/states/StateStack.lua:16: in function 'update'
main.lua:85: in function 'update'
[C]: in function 'xpcall'

Fix:

In BattleMenuState.Lua line 38 the closing parenthesis is in the wrong position so the flag for user input is not properly turned off
change function() end), false) to function() end, false))

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

No branches or pull requests

1 participant