stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src action/action_die.c unit/unit.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src action/action_die.c unit/unit.c
Date: 17 Jan 2004 14:40:04 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/17 14:40:04

Modified files:
        src/action     : action_die.c 
        src/unit       : unit.c 

Log message:
        Fix Fog of war Errors with Building Corpses

Patches:
Index: stratagus/src/action/action_die.c
diff -u stratagus/src/action/action_die.c:1.57 
stratagus/src/action/action_die.c:1.58
--- stratagus/src/action/action_die.c:1.57      Fri Jan 16 02:15:07 2004
+++ stratagus/src/action/action_die.c   Sat Jan 17 14:40:03 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: action_die.c,v 1.57 2004/01/15 15:15:07 nobody_ Exp $
+//      $Id: action_die.c,v 1.58 2004/01/17 03:40:03 wizzard Exp $
 
 //@{
 
@@ -72,18 +72,22 @@
                DebugLevel3("Die complete %d\n" _C_ UnitNumber(unit));
 
                if (!unit->Type->CorpseType) {
+                       // Unmark corpse sight, if it has any
+                       MapUnmarkUnitSight(unit);
                        ReleaseUnit(unit);
                        return;
                }
 
-               // Fixes sight from death
-               MapUnmarkUnitSight(unit);
-
                unit->State = unit->Type->CorpseScript;
 
                DebugCheck(unit->Type->TileWidth != 
unit->Type->CorpseType->TileWidth ||
                                unit->Type->TileHeight != 
unit->Type->CorpseType->TileHeight);
                unit->Type = unit->Type->CorpseType;
+
+               // Update sight for new corpse
+               MapUnmarkUnitSight(unit);
+               unit->CurrentSightRange = unit->Type->Stats->SightRange;
+               MapMarkUnitSight(unit);
 
                CommandStopUnit(unit);                  // This clears all 
order queues
 #ifdef DEBUG
Index: stratagus/src/unit/unit.c
diff -u stratagus/src/unit/unit.c:1.361 stratagus/src/unit/unit.c:1.362
--- stratagus/src/unit/unit.c:1.361     Sat Jan 17 05:17:25 2004
+++ stratagus/src/unit/unit.c   Sat Jan 17 14:40:03 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: unit.c,v 1.361 2004/01/16 18:17:25 nobody_ Exp $
+//      $Id: unit.c,v 1.362 2004/01/17 03:40:03 wizzard Exp $
 
 //@{
 
@@ -2879,15 +2879,19 @@
                                !unit->Type->Animations->Die);
                        UnitShowAnimation(unit, unit->Type->Animations->Die);
                        DebugLevel0Fn("Frame %d\n" _C_ unit->Frame);
+                       unit->CurrentSightRange = type->Stats->SightRange;
+                       MapMarkUnitSight(unit);
+               } else {
+                       // no corpse available
+                       MapMarkUnitSight(unit);
+                       MapUnmarkUnitSight(unit);
+                       unit->CurrentSightRange = 0;
                }
-               // no corpse available
-               // FIXME: (mr-russ) Hack to make sure we see our own building 
destroyed
-               MapMarkUnitSight(unit);
-               MapUnmarkUnitSight(unit);
                return;
        }
 
-       if (unit->Type->Transporter) { // Transporters loose their units
+       // Transporters lose their units
+       if (unit->Type->Transporter) {
                DestroyAllInside(unit);
        }
 
@@ -3776,7 +3780,7 @@
        int j;
 
        CLprintf(file, "\n--- -----------------------------------------\n");
-       CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.361 2004/01/16 
18:17:25 nobody_ Exp $\n\n");
+       CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.362 2004/01/17 
03:40:03 wizzard Exp $\n\n");
 
 #if 0
        //




reply via email to

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