stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src include/unit.h map/map.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src include/unit.h map/map.c
Date: 17 Jan 2004 11:34:06 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/17 11:34:05

Modified files:
        src/include    : unit.h 
        src/map        : map.c 

Log message:
        Fix Reveal neutral units.

Patches:
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.247 stratagus/src/include/unit.h:1.248
--- stratagus/src/include/unit.h:1.247  Sat Jan 17 02:17:25 2004
+++ stratagus/src/include/unit.h        Sat Jan 17 11:34:04 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: unit.h,v 1.247 2004/01/16 15:17:25 wizzard Exp $
+//      $Id: unit.h,v 1.248 2004/01/17 00:34:04 nobody_ Exp $
 
 #ifndef __UNIT_H__
 #define __UNIT_H__
@@ -784,6 +784,10 @@
        /// FIXME: more docu
 extern void NearestOfUnit(const Unit* unit, int tx, int ty, int *dx, int *dy);
 
+       /// Call when an Unit goes under fog.
+extern void UnitGoesUnderFog(Unit* unit, const Player* player);
+       /// Call when an Unit goes out of fog.
+extern void UnitGoesOutOfFog(Unit* unit, const Player* player);
        /// Marks an unit as seen
 extern void UnitsOnTileMarkSeen(const Player* player, int x, int y, int p);
        /// Unmarks an unit as seen
Index: stratagus/src/map/map.c
diff -u stratagus/src/map/map.c:1.74 stratagus/src/map/map.c:1.75
--- stratagus/src/map/map.c:1.74        Sat Jan 17 02:17:25 2004
+++ stratagus/src/map/map.c     Sat Jan 17 11:34:05 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: map.c,v 1.74 2004/01/16 15:17:25 wizzard Exp $
+//     $Id: map.c,v 1.75 2004/01/17 00:34:05 nobody_ Exp $
 
 //@{
 
@@ -136,6 +136,8 @@
 {
        int x;
        int y;
+       int p;
+
        //
        //      Mark every explored tile as visible. 1 turns into 2.
        //
@@ -154,6 +156,20 @@
        //      Global seen recount. Simple and effective.
        //
        for (x = 0; x < NumUnits; ++x) {
+               //
+               //      Reveal neutral buildings. Gold mines:)
+               //
+               if (Units[x]->Player->Type == PlayerNeutral) {
+                       for (p = 0; p < PlayerMax; ++p) {
+                               if (Players[p].Type != PlayerNobody &&
+                                               (!(Units[x]->Seen.ByPlayer & (1 
<< p)))) {
+                                       if (1) {
+                                               UnitGoesOutOfFog(Units[x], 
Players + p);
+                                               UnitGoesUnderFog(Units[x], 
Players + p);
+                                       }
+                               }
+                       }
+               }
                UnitCountSeen(Units[x]);
        }
 }




reply via email to

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