stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src clone/spells.c unit/ccl_unittype.c


From: Martin Renold
Subject: [Stratagus-CVS] stratagus/src clone/spells.c unit/ccl_unittype.c
Date: Sat, 25 Oct 2003 03:42:19 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Martin Renold <address@hidden>  03/10/25 03:42:19

Modified files:
        src/clone      : spells.c 
        src/unit       : ccl_unittype.c 

Log message:
        useful error message on unknown spell

Patches:
Index: stratagus/src/clone/spells.c
diff -u stratagus/src/clone/spells.c:1.114 stratagus/src/clone/spells.c:1.115
--- stratagus/src/clone/spells.c:1.114  Thu Oct 23 21:58:33 2003
+++ stratagus/src/clone/spells.c        Sat Oct 25 03:42:18 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: spells.c,v 1.114 2003/10/24 01:58:33 n0body Exp $
+//     $Id: spells.c,v 1.115 2003/10/25 07:42:18 martinxyz Exp $
 
 /*
 **     And when we cast our final spell
@@ -992,7 +992,7 @@
            return i;
        }
     }
-    return 0xABCDEF;
+    return -1;
 }
 
 /**
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.99 
stratagus/src/unit/ccl_unittype.c:1.100
--- stratagus/src/unit/ccl_unittype.c:1.99      Fri Oct 24 00:40:49 2003
+++ stratagus/src/unit/ccl_unittype.c   Sat Oct 25 03:42:19 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_unittype.c,v 1.99 2003/10/24 04:40:49 mr-russ Exp $
+//     $Id: ccl_unittype.c,v 1.100 2003/10/25 07:42:19 martinxyz Exp $
 
 //@{
 
@@ -525,8 +525,13 @@
            list = gh_cdr(list);
            type->Magic = 0;
            while (!gh_null_p(sublist)) {
-               DebugLevel3Fn("%d \n" _C_ CclGetSpellByIdent(gh_car(sublist)));
-               type->CanCastSpell[CclGetSpellByIdent(gh_car(sublist))] = 1;
+               int id;
+               id = CclGetSpellByIdent(gh_car(sublist));
+               DebugLevel3Fn("%d \n" _C_ id);
+               if (id == -1) {
+                   errl("Unknown spell type", gh_car(sublist));
+               }
+               type->CanCastSpell[id] = 1;
                sublist = gh_cdr(sublist);
                type->Magic = 1;
            }




reply via email to

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