Skip to content

Commit

Permalink
[Replay] Fixed an issue with exiled players (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
cddjr committed Jun 1, 2022
1 parent a326693 commit bfecb62
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions hooks/MeetingHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,16 @@ void dMeetingHud_PopulateResults(MeetingHud* __this, Il2CppArraySize* states, Me
Transform_RemoveAllVotes(transform);
}

if (auto exiled = __this->fields.exiledPlayer; exiled != nullptr) {
std::lock_guard<std::mutex> replayLock(Replay::replayEventMutex);
State.replayDeathTimePerPlayer[exiled->fields.PlayerId] = std::chrono::system_clock::now();
}

auto prevAnonymousVotes = (*Game::pGameOptionsData)->fields.AnonymousVotes;
if (prevAnonymousVotes && State.RevealAnonymousVotes)
(*Game::pGameOptionsData)->fields.AnonymousVotes = false;
__try {
MeetingHud_PopulateResults(__this, states, method);
}
__finally {
(*Game::pGameOptionsData)->fields.AnonymousVotes = prevAnonymousVotes;
}
MeetingHud_PopulateResults(__this, states, method);
(*Game::pGameOptionsData)->fields.AnonymousVotes = prevAnonymousVotes;
}

void RevealAnonymousVotes() {
Expand Down

0 comments on commit bfecb62

Please sign in to comment.