Don't crash when run with -d desync

This commit is contained in:
dP
2021-03-17 19:20:30 +03:00
parent 1381a86a1e
commit de9b2d890c

View File

@@ -259,6 +259,9 @@ void DecodeSettings(BitIStream &bs, Settings &settings) {
uint16 _last_client_version = 1512;
static u8vector EncodeData() {
// Skip if game is not initialized for some reason (i.e. -d desync)
if (!_game) return {};
BitOStream bs;
bs.Reserve(1000);
bs.WriteBytes(SAVEGAME_DATA_FORMAT_VERSION, 2);