stratagus-cvs
[Top][All Lists]
Advanced

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

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


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src action/action_follow.c unit/unit.c
Date: 25 Jan 2004 15:47:28 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/25 15:47:28

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

Log message:
        Fix Destination not removed when portal destroyed.
        Change map Distance to unit to be next to portal

Patches:
Index: stratagus/src/action/action_follow.c
diff -u stratagus/src/action/action_follow.c:1.36 
stratagus/src/action/action_follow.c:1.37
--- stratagus/src/action/action_follow.c:1.36   Thu Jan 15 09:31:01 2004
+++ stratagus/src/action/action_follow.c        Sun Jan 25 15:47:26 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: action_follow.c,v 1.36 2004/01/14 22:31:01 nobody_ Exp $
+//      $Id: action_follow.c,v 1.37 2004/01/25 04:47:26 wizzard Exp $
 
 //@{
 
@@ -127,20 +127,14 @@
                        }
                        // FALL THROUGH
                case PF_REACHED:
-                       // FIXME: dark portal teleportation: Goal is used for 
target circle of power
-                       // FIXME: teleporting of units should use dark portal's 
mana
+                       // Handle Teleporter Units
+                       // FIXME: BAD HACK
                        if ((goal = unit->Orders[0].Goal) &&
                                        goal->Type->Teleporter && goal->Goal &&
-                                       MapDistanceBetweenUnits(unit, goal) < 
4) {
-#if 0
-                               Unit* table[UnitMax];
-#endif
+                                       MapDistanceBetweenUnits(unit, goal) <= 
1) {
                                Unit* dest;
-#if 0
-                               int n;
-                               int i;
-#endif
 
+                               // Teleport the unit
                                RemoveUnit(unit, NULL);
                                unit->X = goal->Goal->X;
                                unit->Y = goal->Goal->Y;
Index: stratagus/src/unit/unit.c
diff -u stratagus/src/unit/unit.c:1.373 stratagus/src/unit/unit.c:1.374
--- stratagus/src/unit/unit.c:1.373     Sat Jan 24 10:35:03 2004
+++ stratagus/src/unit/unit.c   Sun Jan 25 15:47:27 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: unit.c,v 1.373 2004/01/23 23:35:03 wizzard Exp $
+//      $Id: unit.c,v 1.374 2004/01/25 04:47:27 wizzard Exp $
 
 //@{
 
@@ -2798,6 +2798,16 @@
        }
 
        //
+       // Handle Teleporter Destination Removal
+       if (type->Teleporter && unit->Goal) {
+               RemoveUnit(unit->Goal, NULL);
+               UnitLost(unit->Goal);
+               UnitClearOrders(unit->Goal);
+               ReleaseUnit(unit->Goal);
+               unit->Goal = NULL;
+       }
+
+       //
        //              Building,...
        //
        if (type->Building) {
@@ -3756,7 +3766,7 @@
        int j;
 
        CLprintf(file, "\n--- -----------------------------------------\n");
-       CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.373 2004/01/23 
23:35:03 wizzard Exp $\n\n");
+       CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.374 2004/01/25 
04:47:27 wizzard Exp $\n\n");
 
 #if 0
        //




reply via email to

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