From 827e1b2a6bc21e9f61f23e500afd50196f2cd528 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 18 Feb 2018 17:33:12 -0500 Subject: [PATCH] Fix crash when loading a saved game containing boats or horses --- src/universe/party.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/universe/party.cpp b/src/universe/party.cpp index 58faebab..d8af47da 100644 --- a/src/universe/party.cpp +++ b/src/universe/party.cpp @@ -1016,11 +1016,15 @@ void cParty::readFrom(std::istream& file, cScenario& scen){ if(cur == "BOAT") { int i; bin >> i; + if(i >= boats.size()) + boats.resize(i + 1); boats[i].exists = true; boats[i].readFrom(bin); } else if(cur == "HORSE") { int i; bin >> i; + if(i >= horses.size()) + horses.resize(i + 1); horses[i].exists = true; horses[i].readFrom(bin); } else if(cur == "MAGICSTORE") {