stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src/unit ccl_unit.c


From: Russell Smith
Subject: [Stratagus-CVS] stratagus/src/unit ccl_unit.c
Date: Fri, 14 Nov 2003 23:48:18 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/11/14 23:48:18

Modified files:
        src/unit       : ccl_unit.c 

Log message:
        Error Reporting for invalid 'any tag.

Patches:
Index: stratagus/src/unit/ccl_unit.c
diff -u stratagus/src/unit/ccl_unit.c:1.75 stratagus/src/unit/ccl_unit.c:1.76
--- stratagus/src/unit/ccl_unit.c:1.75  Fri Nov 14 23:38:52 2003
+++ stratagus/src/unit/ccl_unit.c       Fri Nov 14 23:48:18 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_unit.c,v 1.75 2003/11/15 04:38:52 mr-russ Exp $
+//     $Id: ccl_unit.c,v 1.76 2003/11/15 04:48:18 mr-russ Exp $
 
 //@{
 
@@ -982,6 +982,7 @@
     UnitType* unittype;
     Unit* unit;
     int heading;
+    int playerno;
     int mask;
     int ix;
     int iy;
@@ -991,7 +992,13 @@
     iy = gh_scm2int(y);
 
     heading = SyncRand() % 256;
-    unit = MakeUnit(unittype, &Players[TriggerGetPlayer(player)]);
+    playerno = TriggerGetPlayer(player);
+    if (playerno == -1) {
+       printf("CreateUnit: You cannot use 'any in create unit, specify a 
player\n");
+       errl("bad player", player);
+       return SCM_UNSPECIFIED;
+    }
+    unit = MakeUnit(unittype, &Players[playerno]);
     mask = UnitMovementMask(unit);
     if (CheckedCanMoveToMask(ix, iy, mask)) {
        unit->Wait = 1;




reply via email to

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