Progress: Client Updates

This commit is contained in:
Jeremiah Billmann
2013-06-01 14:57:04 -04:00
parent a9f92adf60
commit d676f72e19
3 changed files with 6 additions and 10 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ GarageServerGame.prototype.updatePhysics = function (options) {
GarageServerGame.prototype.addPlayer = function (client) {
for(var i = 0; i < this.players.length; i ++) {
if(this.players[i].id === client.id) {
if(this.players[i].client.id === client.id) {
return;
}
}
@@ -46,7 +46,7 @@ GarageServerGame.prototype.addPlayer = function (client) {
GarageServerGame.prototype.removePlayer = function (client) {
for(var i = 0; i < this.players.length; i ++) {
if(this.players[i].id === client.id) {
if(this.players[i].client.id === client.id) {
this.players.splice(i, 1)[0];
return;
}
@@ -55,7 +55,7 @@ GarageServerGame.prototype.removePlayer = function (client) {
GarageServerGame.prototype.addPlayerInput = function (client, input) {
for(var i = 0; i < this.players.length; i ++) {
if(this.players[i].id === client.id) {
if(this.players[i].client.id === client.id) {
this.players[i].inputs.push(input);
return;
}