From 84588e211589760b23614fda2ce66bd165b7cf6c Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Sat, 3 Aug 2013 16:23:09 -0500 Subject: [PATCH] Added ship check if player hasn't had state defined --- example/public/javascripts/game.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/public/javascripts/game.js b/example/public/javascripts/game.js index d5c03c6..4b86f5f 100644 --- a/example/public/javascripts/game.js +++ b/example/public/javascripts/game.js @@ -35,7 +35,9 @@ $(function () { drawRotatedImage(entity.state.ang, entity.state.x, entity.state.y, entityImage); }); playerStates.forEach(function (player) { - drawRotatedImage(player.state.ang, player.state.x, player.state.y, ships[player.state.ship]); + if (player.state.ship) { + drawRotatedImage(player.state.ang, player.state.x, player.state.y, ships[player.state.ship]); + } }); }, //Update Loop