stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus doc/ChangeLog.html src/clone/selection.c


From: Russell Smith
Subject: [Stratagus-CVS] stratagus doc/ChangeLog.html src/clone/selection.c
Date: Sun, 09 Nov 2003 16:19:12 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/11/09 16:19:12

Modified files:
        doc            : ChangeLog.html 
        src/clone      : selection.c 

Log message:
        Fixed Bug #6443: Can't Load Selections from Save Game

Patches:
Index: stratagus/doc/ChangeLog.html
diff -u stratagus/doc/ChangeLog.html:1.569 stratagus/doc/ChangeLog.html:1.570
--- stratagus/doc/ChangeLog.html:1.569  Sat Nov  8 01:54:02 2003
+++ stratagus/doc/ChangeLog.html        Sun Nov  9 16:19:11 2003
@@ -2,7 +2,7 @@
 <html>
 <head>
 <!--
-----   $Id: ChangeLog.html,v 1.569 2003/11/08 06:54:02 mr-russ Exp $
+----   $Id: ChangeLog.html,v 1.570 2003/11/09 21:19:11 mr-russ Exp $
 
 ----   (c) Copyright 1998-2003 by Lutz Sammer
 
@@ -36,6 +36,7 @@
 <li>Future 2.00 Release<p>
     <ul>
     <li>++
+    <li>Fixed Bug #6443: Can't Load Selections from Save Game (from Russell 
Smith).
     <li>Fixed Bug #6301: Fog of War problem after using Holy Vision (from 
Russell Smith).
     <li>Fixed Bug #6306: DebugCheck at src/clone/unit_draw.c:895 (from Russell 
Smith).
     <li>Allow selection of more than 9 units (from Nehal Mistry).
Index: stratagus/src/clone/selection.c
diff -u stratagus/src/clone/selection.c:1.57 
stratagus/src/clone/selection.c:1.58
--- stratagus/src/clone/selection.c:1.57        Fri Nov  7 20:08:08 2003
+++ stratagus/src/clone/selection.c     Sun Nov  9 16:19:12 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: selection.c,v 1.57 2003/11/08 01:08:08 nehalmistry Exp $
+//     $Id: selection.c,v 1.58 2003/11/09 21:19:12 mr-russ Exp $
 
 //@{
 
@@ -962,14 +962,8 @@
 */
 global void InitSelections(void)
 {
-    int i;
-
-    Selected = malloc(MaxSelectable * sizeof(Unit*));
-
-    if ((i = NumSelected)) {           // Cleanup after load
-       while (i--) {
-           Selected[i] = UnitSlots[(int)Selected[i]];
-       }
+    if (!Selected) {
+       Selected = malloc(MaxSelectable * sizeof(Unit*));
     }
 }
 
@@ -984,7 +978,7 @@
     char* ref;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: selection $Id: selection.c,v 1.57 2003/11/08 
01:08:08 nehalmistry Exp $\n\n");
+    CLprintf(file, ";;; MODULE: selection $Id: selection.c,v 1.58 2003/11/09 
21:19:12 mr-russ Exp $\n\n");
 
     CLprintf(file, "(set-group-id! %d)\n", GroupId);
     CLprintf(file, "(selection %d '(", NumSelected);
@@ -1036,13 +1030,14 @@
 {
     int i;
 
+    InitSelections();
     NumSelected = gh_scm2int(num);
     i = 0;
     while (!gh_null_p(units)) {
        char* str;
 
        str = gh_scm2newstr(gh_car(units), NULL);
-       Selected[i++] = (Unit*)strtol(str + 1, NULL, 16);
+       Selected[i++] = UnitSlots[strtol(str + 1, NULL, 16)];
        free(str);
        units = gh_cdr(units);
     }




reply via email to

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