Commit 3df1f6e3 authored by nanahira's avatar nanahira

fix score before starting

parent 9b75bb75
...@@ -1280,11 +1280,12 @@ class Room ...@@ -1280,11 +1280,12 @@ class Room
client.server.destroy() client.server.destroy()
else else
#log.info(client.name, @started, @disconnector, @random_type, @players.length) #log.info(client.name, @started, @disconnector, @random_type, @players.length)
if @arena and !@started if @arena and !@started and @disconnector != 'server' and !@arena_score_handled
for player in @players when player.pos != 7 for player in @players when player.pos != 7
@scores[player.name_vpass] = 0 @scores[player.name_vpass] = 0
if @players.length == 2 if @players.length == 2
@scores[client.name_vpass] = -9 @scores[client.name_vpass] = -9
@arena_score_handled = true
index = _.indexOf(@players, client) index = _.indexOf(@players, client)
@players.splice(index, 1) unless index == -1 @players.splice(index, 1) unless index == -1
if @started and @disconnector != 'server' and client.pos < 4 if @started and @disconnector != 'server' and client.pos < 4
......
...@@ -1667,7 +1667,7 @@ ...@@ -1667,7 +1667,7 @@
} }
client.server.destroy(); client.server.destroy();
} else { } else {
if (this.arena && !this.started) { if (this.arena && !this.started && this.disconnector !== 'server' && !this.arena_score_handled) {
ref2 = this.players; ref2 = this.players;
for (m = 0, len2 = ref2.length; m < len2; m++) { for (m = 0, len2 = ref2.length; m < len2; m++) {
player = ref2[m]; player = ref2[m];
...@@ -1678,6 +1678,7 @@ ...@@ -1678,6 +1678,7 @@
if (this.players.length === 2) { if (this.players.length === 2) {
this.scores[client.name_vpass] = -9; this.scores[client.name_vpass] = -9;
} }
this.arena_score_handled = true;
} }
index = _.indexOf(this.players, client); index = _.indexOf(this.players, client);
if (index !== -1) { if (index !== -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment