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

Commit

Permalink
fix major bug in detecting events in non square maps!
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Nov 12, 2016
1 parent 2165c36 commit 9680664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ player.setup = function() {
player.waits = 16
}
} else {
if (py - 1 > 0 && px - 1 > 0 && px + 1 < engine.currentLevel["Level"]["events"].length && px + 1 < engine.currentLevel["Level"]["events"].length) {
if (py - 1 > 0 && px - 1 > 0 && px + 1 < engine.currentLevel["Level"]["events"][0].length && py + 1 < engine.currentLevel["Level"]["events"].length) {
var fpos = player.facingPosition()
if (eventInMap(engine.currentLevel["Level"], [1, 0], fpos)) {
HID.inputs["accept"].active = false
Expand Down

0 comments on commit 9680664

Please sign in to comment.