Skip to content

Explosion sprite frame crash#18

Open
karjonas wants to merge 3 commits intomartinohanlon:masterfrom
karjonas:explosion_sprite_frame_crash
Open

Explosion sprite frame crash#18
karjonas wants to merge 3 commits intomartinohanlon:masterfrom
karjonas:explosion_sprite_frame_crash

Conversation

@karjonas
Copy link

@karjonas karjonas commented Jan 8, 2017

When running with very slow fps the calculated frame sprite number could become too high leading to a crash when reading outside the sprite array. This fixes the issue and makes the code a bit clearer.

The sprite frame is now calculated by the function and made sure not to index outside the number of available frames.

Also added defines and names for magic constants used to clarify.
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

Successfully merging this pull request may close these issues.

1 participant