Commit 01fc559d authored by edo9300's avatar edo9300

Fixed turn count with single play replays

parent 9ced490a
......@@ -85,6 +85,7 @@ int ReplayMode::ReplayThread(void* param) {
}
mainGame->dInfo.isStarted = true;
mainGame->dInfo.isReplay = true;
mainGame->dInfo.turn = 0;
mainGame->dInfo.isReplaySkiping = (skip_turn > 0);
is_continuing = true;
skip_step = 0;
......@@ -253,6 +254,18 @@ bool ReplayMode::ReplayAnalyze(BufferIO::ReplayPacket p) {
}
break;
}
case MSG_AI_NAME: {
char* pbuf =(char*) p.data;
char namebuf[128];
wchar_t wname[128];
int len = BufferIO::ReadInt16(pbuf);
char* begin = pbuf;
pbuf += len + 1;
memcpy(namebuf, begin, len + 1);
BufferIO::DecodeUTF8(namebuf, wname);
BufferIO::CopyWStr(wname, mainGame->dInfo.clientname, 20);
return true;
}
case OLD_REPLAY_MODE:
return true;
}
......
......@@ -113,6 +113,7 @@ int SingleMode::SinglePlayThread(void* param) {
//records the replay with the new system
new_replay.BeginRecord();
rh.id = 0x58707279;
rh.flag |= REPLAY_NEWREPLAY;
new_replay.WriteHeader(rh);
replay_stream.clear();
unsigned short buffer[20];
......@@ -848,7 +849,6 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
memcpy(namebuf, begin, len + 1);
BufferIO::DecodeUTF8(namebuf, wname);
BufferIO::CopyWStr(wname, mainGame->dInfo.clientname, 20);
record = false;
break;
}
case MSG_SHOW_HINT: {
......
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