stratagus-cvs
[Top][All Lists]
Advanced

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

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


From: Russell Smith
Subject: [Stratagus-CVS] stratagus/src/map map.c
Date: Fri, 05 Dec 2003 23:25:45 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/12/05 23:25:45

Modified files:
        src/map        : map.c 

Log message:
        Neutral Units shown on RevealMap

Patches:
Index: stratagus/src/map/map.c
diff -u stratagus/src/map/map.c:1.67 stratagus/src/map/map.c:1.68
--- stratagus/src/map/map.c:1.67        Sun Nov 30 15:03:33 2003
+++ stratagus/src/map/map.c     Fri Dec  5 23:25:45 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: map.c,v 1.67 2003/11/30 20:03:33 jsalmon3 Exp $
+//     $Id: map.c,v 1.68 2003/12/06 04:25:45 mr-russ Exp $
 
 //@{
 
@@ -134,6 +134,7 @@
 {
     int ix;
     int iy;
+    Unit* unit;
 
     for (ix = 0; ix < TheMap.Width; ++ix) {
        for (iy = 0; iy < TheMap.Height; ++iy) {
@@ -146,6 +147,28 @@
            MapMarkSeenTile(ix, iy);
            UnitsMarkSeen(ix, iy);
        }
+    }
+    for (ix = 0; ix < Players[PlayerNumNeutral].TotalNumUnits; ++ix) {
+       unit = Players[PlayerNumNeutral].Units[ix];
+       unit->SeenIY = unit->IY;
+       unit->SeenIX = unit->IX;
+       if (unit->SeenFrame == UnitNotSeen) {
+           DebugLevel3Fn("unit %d at %d,%d first seen at %lu.\n" _C_
+               unit->Slot _C_ unit->X _C_ unit->Y _C_ GameCycle);
+       }
+       unit->SeenFrame = unit->Frame;
+       unit->SeenState = (unit->Orders[0].Action == UnitActionBuilded) |
+           ((unit->Orders[0].Action == UnitActionUpgradeTo) << 1);
+       if (unit->Orders[0].Action == UnitActionDie) {
+           unit->SeenState = 3;
+       }
+       if (unit->SeenState == 2) {
+           unit->SeenType = unit->Orders[0].Type;
+       } else {
+           unit->SeenType = unit->Type;
+       }
+       unit->SeenConstructed = unit->Constructed;
+       unit->SeenDestroyed = unit->Destroyed;
     }
 }
 




reply via email to

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