mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 02:44:50 +00:00
fix servergenerated replays
if this is a reloaded game then we dont need to add [start]
This commit is contained in:
parent
7dfc3760e6
commit
0e3b185f62
@ -1488,10 +1488,13 @@ void game::save_replay() {
|
||||
<< "[/replay]\n"
|
||||
<< "[replay_start]\n" << level_.output() << "[/replay_start]\n";
|
||||
#else
|
||||
const bool has_old_replay = level_.child("replay") != NULL;
|
||||
//If there is already a replay in the level_, which means this is a reloaded game,
|
||||
//then we dont need to add the [start] in the replay.
|
||||
replay_data << level_.output()
|
||||
//This can result in having 2 [replay] at toplevel since level_ can contain one already. But the client can handle this (simply merges them).
|
||||
<< "[replay]\n"
|
||||
<< "\t[command]\n\t\t[start]\n\t\t[/start]\n\t[/command]\n" //this is required by gfgtdf's sync mechanism, in PR 121
|
||||
<< (has_old_replay ? "" : "\t[command]\n\t\t[start]\n\t\t[/start]\n\t[/command]\n") //this is required by gfgtdf's sync mechanism, in PR 121
|
||||
<< replay_commands
|
||||
<< "[/replay]\n";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user