Skip to content
Snippets Groups Projects
Commit 082c85eb authored by echicken's avatar echicken
Browse files

Don't putWeapon() at invalid coordinates. :|

parent 1df003ac
No related branches found
No related tags found
No related merge requests found
...@@ -492,6 +492,8 @@ function Sprite(spriteName, parentFrame, x, y, bearing) { ...@@ -492,6 +492,8 @@ function Sprite(spriteName, parentFrame, x, y, bearing) {
default: default:
break; break;
} }
if(this.weaponCoordinates.x < 1 || this.weaponCoordinates.x > 80 || this.weaponCoordinates.y < 1 || this.weaponCoordinates.y > 24)
return false;
var w = new Sprite(this.ini.weapon, this.frame.parent, this.weaponCoordinates.x, this.weaponCoordinates.y, this.bearing); var w = new Sprite(this.ini.weapon, this.frame.parent, this.weaponCoordinates.x, this.weaponCoordinates.y, this.bearing);
w.frame.draw(); // Shouldn't be necessary, but sprite doesn't appear unless I do this w.frame.draw(); // Shouldn't be necessary, but sprite doesn't appear unless I do this
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment