Commit 226d1faf authored by nanahira's avatar nanahira

fix random room

parent f652cfe7
...@@ -3020,12 +3020,14 @@ ygopro.stoc_follow 'HS_PLAYER_CHANGE', true, (buffer, info, client, server, data ...@@ -3020,12 +3020,14 @@ ygopro.stoc_follow 'HS_PLAYER_CHANGE', true, (buffer, info, client, server, data
is_ready = (info.status & 0xf) == 9 is_ready = (info.status & 0xf) == 9
room.ready_player_count = 0 room.ready_player_count = 0
room.ready_player_count_without_host = 0 room.ready_player_count_without_host = 0
for player in room.players for player in room.get_playing_player()
if player.pos == pos if player.pos == pos
player.is_ready = is_ready player.is_ready = is_ready
if player.is_ready if player.is_ready
++room.ready_player_count ++room.ready_player_count
unless player.is_host unless _.any(room.players, (tplayer) ->
return tplayer.pos > 3 and tplayer.name_vpass == player.name_vpass and tplayer.is_host
)
++room.ready_player_count_without_host ++room.ready_player_count_without_host
if settings.modules.athletic_check.enabled if settings.modules.athletic_check.enabled
possibly_max_player = if room.hostinfo.mode == 2 then 4 else 2 possibly_max_player = if room.hostinfo.mode == 2 then 4 else 2
......
...@@ -3988,7 +3988,7 @@ ...@@ -3988,7 +3988,7 @@
is_ready = (info.status & 0xf) === 9; is_ready = (info.status & 0xf) === 9;
room.ready_player_count = 0; room.ready_player_count = 0;
room.ready_player_count_without_host = 0; room.ready_player_count_without_host = 0;
ref = room.players; ref = room.get_playing_player();
for (j = 0, len = ref.length; j < len; j++) { for (j = 0, len = ref.length; j < len; j++) {
player = ref[j]; player = ref[j];
if (player.pos === pos) { if (player.pos === pos) {
...@@ -3996,7 +3996,9 @@ ...@@ -3996,7 +3996,9 @@
} }
if (player.is_ready) { if (player.is_ready) {
++room.ready_player_count; ++room.ready_player_count;
if (!player.is_host) { if (!_.any(room.players, function(tplayer) {
return tplayer.pos > 3 && tplayer.name_vpass === player.name_vpass && tplayer.is_host;
})) {
++room.ready_player_count_without_host; ++room.ready_player_count_without_host;
} }
} }
......
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