Batch #6218 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_21368 CGameMode::UpdateReplayPause: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, alisonrag, gordaoprogramas Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). Adds to the build: Source/Client/Mode/GameModeReplay.cpp
24 lines
611 B
C++
24 lines
611 B
C++
#include "Client/Mode/CGameMode.h"
|
|
#include "Client/Replay.h"
|
|
|
|
#include <windows.h>
|
|
#include <timeapi.h>
|
|
|
|
// OFFSET: 0x00CED670
|
|
// FUNCTION: fn_21368
|
|
bool CGameMode::UpdateReplayPause(bool resume) {
|
|
if (resume == true && this->replayPauseTick != 0) {
|
|
if (Replay::Instance().state != 7) {
|
|
const std::uint32_t paused = timeGetTime() - this->replayPauseTick;
|
|
Replay::Instance().started += paused;
|
|
}
|
|
} else if (Replay::Instance().state == 7) {
|
|
this->replayPauseTick = timeGetTime();
|
|
}
|
|
|
|
if (this->replayPauseTick == 0) {
|
|
Replay::Instance().RestartClock();
|
|
}
|
|
|
|
return resume;
|
|
}
|