From f5b845a611239fc12c41fc098a309560bbdd51f1 Mon Sep 17 00:00:00 2001 From: Buginator Date: Sun, 19 Sep 2010 01:53:23 +0000 Subject: [PATCH] Do a bounds check not to exceed NUM_FACTORY_TYPES. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/2.3@11684 4a71c877-e1ca-e34f-864e-861f7616d084 (cherry picked from commit 4b45c471c60d2ae1d9c25e4f96f2c7574f73e1f1) --- src/hci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hci.c b/src/hci.c index 04b22b228..2bd687b0d 100644 --- a/src/hci.c +++ b/src/hci.c @@ -3531,6 +3531,10 @@ static void orderFactories(void) { inc = 0; type++; + if (type > NUM_FACTORY_TYPES) + { + type = 0; + } } objectInc = 0; }