Commit 0cf955ec authored by wind2009's avatar wind2009

Merge remote-tracking branch 'salix/patch-rp' into develop

parents 24c17c10 d59e03c3
......@@ -138,6 +138,8 @@ bool Replay::OpenReplay(const wchar_t* name) {
Reset();
return false;
}
info_offset = data_position;
data_position = 0;
return true;
}
bool Replay::CheckReplay(const wchar_t* name) {
......@@ -218,11 +220,15 @@ void Replay::Reset() {
replay_size = 0;
comp_size = 0;
data_position = 0;
info_offset = 0;
players.clear();
params = { 0 };
decks.clear();
script_name.clear();
}
void Replay::SkipInfo(){
data_position += info_offset;
}
bool Replay::ReadInfo() {
int player_count = (pheader.flag & REPLAY_TAG) ? 4 : 2;
for (int i = 0; i < player_count; ++i) {
......
......@@ -80,6 +80,7 @@ public:
int32_t ReadInt32();
void Rewind();
void Reset();
void SkipInfo();
FILE* fp{ nullptr };
#ifdef _WIN32
......@@ -102,6 +103,7 @@ private:
unsigned char* replay_data;
size_t replay_size{};
size_t data_position{};
size_t info_offset{};
bool is_recording{};
bool is_replaying{};
bool can_read{};
......
......@@ -158,6 +158,7 @@ bool ReplayMode::StartDuel() {
const ReplayHeader& rh = cur_replay.pheader;
unsigned int seed = rh.seed;
std::mt19937 rnd(seed);
cur_replay.SkipInfo();
if(mainGame->dInfo.isTag) {
BufferIO::CopyWideString(cur_replay.players[0].c_str(), mainGame->dInfo.hostname);
BufferIO::CopyWideString(cur_replay.players[1].c_str(), mainGame->dInfo.hostname_tag);
......
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