Commit 506deafa authored by mercury233's avatar mercury233

fix counting flee

parent 94231f06
...@@ -420,7 +420,7 @@ ROOM_player_get_score = (player)-> ...@@ -420,7 +420,7 @@ ROOM_player_get_score = (player)->
score = ROOM_players_scores[name] score = ROOM_players_scores[name]
if !score if !score
return "#{player.name} ${random_score_blank}" return "#{player.name} ${random_score_blank}"
total = score.win + score.lose + score.flee total = score.win + score.lose
if score.win < 2 and total < 3 if score.win < 2 and total < 3
return "#{player.name} ${random_score_not_enough}" return "#{player.name} ${random_score_not_enough}"
if score.combo >= 2 if score.combo >= 2
...@@ -1237,7 +1237,8 @@ class Room ...@@ -1237,7 +1237,8 @@ class Room
@scores[client.name_vpass] = -9 @scores[client.name_vpass] = -9
if @random_type and not client.flee_free and (!settings.modules.reconnect.enabled or @get_disconnected_count() == 0) if @random_type and not client.flee_free and (!settings.modules.reconnect.enabled or @get_disconnected_count() == 0)
ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}") ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}")
ROOM_player_flee(client.name_vpass) if settings.modules.random_duel.record_match_scores and @random_type == 'M'
ROOM_player_flee(client.name_vpass)
if @players.length and !(@windbot and client.is_host) and !(@arena and !@started and client.pos <= 3) if @players.length and !(@windbot and client.is_host) and !(@arena and !@started and client.pos <= 3)
ygopro.stoc_send_chat_to_room this, "#{client.name} ${left_game}" + if error then ": #{error}" else '' ygopro.stoc_send_chat_to_room this, "#{client.name} ${left_game}" + if error then ": #{error}" else ''
roomlist.update(this) if !@windbot and !@started and settings.modules.http.websocket_roomlist roomlist.update(this) if !@windbot and !@started and settings.modules.http.websocket_roomlist
......
...@@ -517,7 +517,7 @@ ...@@ -517,7 +517,7 @@
if (!score) { if (!score) {
return player.name + " ${random_score_blank}"; return player.name + " ${random_score_blank}";
} }
total = score.win + score.lose + score.flee; total = score.win + score.lose;
if (score.win < 2 && total < 3) { if (score.win < 2 && total < 3) {
return player.name + " ${random_score_not_enough}"; return player.name + " ${random_score_not_enough}";
} }
...@@ -1598,7 +1598,9 @@ ...@@ -1598,7 +1598,9 @@
this.scores[client.name_vpass] = -9; this.scores[client.name_vpass] = -9;
if (this.random_type && !client.flee_free && (!settings.modules.reconnect.enabled || this.get_disconnected_count() === 0)) { if (this.random_type && !client.flee_free && (!settings.modules.reconnect.enabled || this.get_disconnected_count() === 0)) {
ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}"); ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}");
ROOM_player_flee(client.name_vpass); if (settings.modules.random_duel.record_match_scores && this.random_type === 'M') {
ROOM_player_flee(client.name_vpass);
}
} }
} }
} }
......
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