This fixes a bug with pathfinding not referring to the correct tile events.