@@ -34,30 +34,33 @@ void dMeetingHud_Close(MeetingHud* __this, MethodInfo* method) {
3434 PlayerControl_CmdCheckName(p, GetPlayerOutfit(playerData)->fields.PlayerName, NULL);
3535 }
3636 }*/
37- uint8_t alivePlayers = 0 ;
38- for (auto p : GetAllPlayerData ()) {
39- if (!p->fields .IsDead ) alivePlayers++;
40- }
41- for (auto i : State.voteMonitor ) {
42- if (alivePlayers < 7 ) break ;
43- auto voter = GetPlayerDataById (i.first ), target = GetPlayerDataById (i.second );
44- if (target == NULL || target->fields .IsDead ) continue ;
45- std::string voterFc = convert_from_string (voter->fields .FriendCode ), targetFc = convert_from_string (target->fields .FriendCode );
46- if (!PlayerIsImpostor (voter) &&
47- std::find (State.tournamentCallers .begin (), State.tournamentCallers .end (), voterFc) == State.tournamentCallers .end () &&
48- std::find (State.tournamentCalledOut .begin (), State.tournamentCalledOut .end (), targetFc) == State.tournamentCalledOut .end ()) {
49- if (PlayerIsImpostor (target)) {
50- UpdatePoints (voter, 1.5 ); // CorrectCallout
51- State.tournamentCalloutPoints [voterFc] += 1 ;
52- LOG_DEBUG (" Correct callout by " + ToString (target));
53- State.tournamentCorrectCallers [voterFc] = target->fields .PlayerId ;
54- }
55- else {
56- UpdatePoints (voter, -1.5 ); // IncorrectCallout
57- LOG_DEBUG (" Incorrect callout by " + ToString (target));
37+ State.vanishedPlayers .clear ();
38+ if (IsHost () && State.TournamentMode ) {
39+ uint8_t alivePlayers = 0 ;
40+ for (auto p : GetAllPlayerData ()) {
41+ if (!p->fields .IsDead ) alivePlayers++;
42+ }
43+ for (auto i : State.voteMonitor ) {
44+ if (alivePlayers < 7 ) break ;
45+ auto voter = GetPlayerDataById (i.first ), target = GetPlayerDataById (i.second );
46+ if (target == NULL || target->fields .IsDead ) continue ;
47+ std::string voterFc = convert_from_string (voter->fields .FriendCode ), targetFc = convert_from_string (target->fields .FriendCode );
48+ if (!PlayerIsImpostor (voter) &&
49+ std::find (State.tournamentCallers .begin (), State.tournamentCallers .end (), voterFc) == State.tournamentCallers .end () &&
50+ std::find (State.tournamentCalledOut .begin (), State.tournamentCalledOut .end (), targetFc) == State.tournamentCalledOut .end ()) {
51+ if (PlayerIsImpostor (target)) {
52+ UpdatePoints (voter, 1.5 ); // CorrectCallout
53+ State.tournamentCalloutPoints [voterFc] += 1 ;
54+ LOG_DEBUG (" Correct callout by " + ToString (target));
55+ State.tournamentCorrectCallers [voterFc] = target->fields .PlayerId ;
56+ }
57+ else {
58+ UpdatePoints (voter, -1.5 ); // IncorrectCallout
59+ LOG_DEBUG (" Incorrect callout by " + ToString (target));
60+ }
61+ State.tournamentCallers .push_back (voterFc);
62+ State.tournamentCalledOut .push_back (targetFc);
5863 }
59- State.tournamentCallers .push_back (voterFc);
60- State.tournamentCalledOut .push_back (targetFc);
6164 }
6265 }
6366 }
0 commit comments