[*] Write AIScript to replay file to prevent desync

[*] Do not deselect units under fog in replay mode
This commit is contained in:
cybermind 2015-03-18 15:15:55 +05:00
parent 0fe0f99ba1
commit 2776073cb5
2 changed files with 4 additions and 1 deletions

View file

@ -464,7 +464,7 @@ static void UnitActionsEachCycle(UNITP_ITERATOR begin, UNITP_ITERATOR end)
continue;
}
if (unit.Selected && !unit.IsVisible(*ThisPlayer)) {
if (!ReplayRevealMap && unit.Selected && !unit.IsVisible(*ThisPlayer)) {
UnSelectUnit(unit);
SelectionChanged();
}

View file

@ -348,6 +348,7 @@ static void SaveFullLog(CFile &file)
} else {
file.printf("\t{");
}
file.printf(" AIScript = \"%s\",", CurrentReplay->Players[i].AIScript.c_str());
file.printf(" PlayerColor = %d,", CurrentReplay->Players[i].PlayerColor);
file.printf(" Race = %d,", CurrentReplay->Players[i].Race);
file.printf(" Team = %d,", CurrentReplay->Players[i].Team);
@ -630,6 +631,8 @@ static int CclReplayLog(lua_State *l)
value = LuaToString(l, -2);
if (!strcmp(value, "Name")) {
replay->Players[j].Name = LuaToString(l, -1);
} else if (!strcmp(value, "AIScript")) {
replay->Players[j].AIScript = LuaToString(l, -1);
} else if (!strcmp(value, "PlayerColor")) {
replay->Players[j].PlayerColor = LuaToNumber(l, -1);
} else if (!strcmp(value, "Race")) {