Prevents adding damage after round has ended

Because it created double round endings, which led to crashes.
Also moved inBetweenRound state from PlayerController to GameController.
This commit is contained in:
logsol 2016-10-01 19:12:52 +02:00
parent c068592915
commit 3a5af058ef
7 changed files with 36 additions and 26 deletions

View file

@ -13,7 +13,7 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect
"use strict";
function Player (id, physicsEngine, user) {
function Player (id, physicsEngine, user, revealedGameController) {
this.stats = {
health: 100,
deaths: 0,
@ -27,7 +27,9 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect
this.id = id;
this.spawned = false;
this.holdingItem = null;
this.inBetweenRounds = true;
this.spectatorDoll = new SpectatorDoll(this.physicsEngine, "spectatorDoll-" + this.id, this);
this.revealedGameController = revealedGameController;
}
Player.prototype.getNickname = function() {
@ -185,7 +187,11 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect
}
Player.prototype.setInBetweenRounds = function(inBetweenRounds) {
return this.playerController.setInBetweenRounds(inBetweenRounds);
this.inBetweenRounds = inBetweenRounds;
};
Player.prototype.isInBetweenRounds = function() {
return this.inBetweenRounds;
};
return Player;