Added ship check if player hasn't had state defined

This commit is contained in:
Jeremiah Billmann
2013-08-03 16:23:09 -05:00
parent c9da04feab
commit 84588e2115
+3 -1
View File
@@ -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