stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/stratagus groups.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/stratagus groups.c
Date: 29 Jan 2004 18:19:47 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/29 18:19:47

Modified files:
        src/stratagus  : groups.c 

Log message:
        Fixed Crash Loading Groups, Not initialized or assigned correctly

Patches:
Index: stratagus/src/stratagus/groups.c
diff -u stratagus/src/stratagus/groups.c:1.32 
stratagus/src/stratagus/groups.c:1.33
--- stratagus/src/stratagus/groups.c:1.32       Sat Jan 17 02:17:30 2004
+++ stratagus/src/stratagus/groups.c    Thu Jan 29 18:19:47 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: groups.c,v 1.32 2004/01/16 15:17:30 wizzard Exp $
+//     $Id: groups.c,v 1.33 2004/01/29 07:19:47 wizzard Exp $
 
 //@{
 
@@ -89,7 +89,7 @@
        char* ref;
 
        CLprintf(file, "\n--- -----------------------------------------\n");
-       CLprintf(file, "--- MODULE: groups $Id: groups.c,v 1.32 2004/01/16 
15:17:30 wizzard Exp $\n\n");
+       CLprintf(file, "--- MODULE: groups $Id: groups.c,v 1.33 2004/01/29 
07:19:47 wizzard Exp $\n\n");
 
        for (g = 0; g < NUM_GROUPS; ++g) {
                CLprintf(file, "Group(%d, %d, {", g, Groups[g].NumUnits);
@@ -247,6 +247,7 @@
                lua_error(l);
        }
 
+       InitGroups();
        grp = &Groups[(int)LuaToNumber(l, 1)];
        grp->NumUnits = LuaToNumber(l, 2);
        i = 0;
@@ -257,7 +258,7 @@
                lua_rawgeti(l, 3, j + 1);
                str = LuaToString(l, -1);
                lua_pop(l, 1);
-               grp->Units[i++] = (Unit*)strtol(str + 1, NULL, 16);
+               grp->Units[i++] = UnitSlots[strtol(str + 1, NULL, 16)];
        }
 
        return 0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]