From a1118351993f66ea3ad52ba750efac59dbb4a29c Mon Sep 17 00:00:00 2001 From: Buginator Date: Sun, 19 Sep 2010 16:46:58 +0000 Subject: [PATCH] Fix SP bug that didn't set the limits correctly for the Cyborg Factory, it really should be fixed in the scripts, however, this will not harm anything, just note that the current limit is MAX_FACTORY which is currently 5. This will *not* fix savegames that already went past the limit! NOTE: Our next release after 2.3.5 will have it fixed in the scripts. refs ticket:2173 git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/2.3@11697 4a71c877-e1ca-e34f-864e-861f7616d084 (cherry picked from commit d20fe58222bc883f8be849965217d6245d03cf72) --- src/structure.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/structure.c b/src/structure.c index 2c7a09273..d51ca6314 100644 --- a/src/structure.c +++ b/src/structure.c @@ -1629,6 +1629,15 @@ STRUCTURE* buildStructureDir(STRUCTURE_STATS *pStructureType, UDWORD x, UDWORD y ASSERT_OR_RETURN(NULL, max <= numStructureStats, "Invalid structure type"); + if (!strcmp(pStructureType->pName, "A0CyborgFactory") && player == 0 && !bMultiPlayer) + { + // HACK: correcting SP bug, needs fixing in script(!!) (only applies for player 0) + // should be OK for Skirmish/MP games, since that is set correctly. + // scrSetStructureLimits() is called by scripts to set this normally. + asStructLimits[player][max].limit = MAX_FACTORY; + asStructLimits[player][max].globalLimit = MAX_FACTORY; + } + if (!strcmp(pStructureType->pName, "A0CyborgFactory") && player == 0 && !bMultiPlayer) { // HACK: correcting SP bug, needs fixing in script(!!) (only applies for player 0)