From 0877397dc206c525468b03bfa2566bf81f408fd4 Mon Sep 17 00:00:00 2001 From: DCoder1337 Date: Fri, 2 Mar 2012 08:08:27 +0200 Subject: [PATCH] Related to bug #896285: properly set the Count when copying the vector. Why the hell did it work for me then? --- src/Ares.version.h | 4 ++-- src/Ext/HouseType/Body.cpp | 1 + src/Ext/HouseType/Hooks.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Ares.version.h b/src/Ares.version.h index 693ef3322..882833975 100644 --- a/src/Ares.version.h +++ b/src/Ares.version.h @@ -2,8 +2,8 @@ #define VERSION_H #define VERSION_MAJOR 12 -#define VERSION_MINOR 61 -#define VERSION_REVISION 1040 +#define VERSION_MINOR 62 +#define VERSION_REVISION 360 #define SAVEGAME_MAGIC ((VERSION_MAJOR << 24) | (VERSION_MINOR << 16) | (VERSION_REVISION)) diff --git a/src/Ext/HouseType/Body.cpp b/src/Ext/HouseType/Body.cpp index b517e9fd8..55e2d26e6 100644 --- a/src/Ext/HouseType/Body.cpp +++ b/src/Ext/HouseType/Body.cpp @@ -306,6 +306,7 @@ void CopyVector(T HouseTypeExt::ExtData::* prop, const HouseTypeExt::ExtData *sr auto &sp = src->*prop; auto &dp = dst->*prop; dp.SetCapacity(sp.Capacity, NULL); + dp.Count = sp.Count; for(unsigned ix = sp.Count; ix > 0; --ix) { auto idx = ix - 1; dp.Items[idx] = sp.Items[idx]; diff --git a/src/Ext/HouseType/Hooks.cpp b/src/Ext/HouseType/Hooks.cpp index 83c4bb1ad..4a69706cc 100644 --- a/src/Ext/HouseType/Hooks.cpp +++ b/src/Ext/HouseType/Hooks.cpp @@ -196,6 +196,7 @@ DEFINE_HOOK(4FE782, HTExt_PickPowerplant, 6) pResult = Eligible.at(idx); } else if(pData->Powerplants.Count) { pResult = pData->Powerplants[0]; + Debug::Log("Country [%s] wanted to build a powerplant but does not meet prerequisites for any possible plant. Going to give it the first one on the list (%s)\n", H->Type->ID, pResult->ID); } else { Debug::Log("Country [%s] did not find any powerplants it could construct! The AI's probably going to crash now...\n", H->Type->ID); }