[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src action/action_die.c include/map.h...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src action/action_die.c include/map.h... |
Date: |
30 Jan 2004 20:48:02 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/30 20:48:01
Modified files:
src/action : action_die.c
src/include : map.h
src/unit : unit.c unit_draw.c unit_find.c
Log message:
Fix shooting at cloacked units.
Fix vision bug when killing detectors.
Patches:
Index: stratagus/src/action/action_die.c
diff -u stratagus/src/action/action_die.c:1.59
stratagus/src/action/action_die.c:1.60
--- stratagus/src/action/action_die.c:1.59 Wed Jan 28 07:54:44 2004
+++ stratagus/src/action/action_die.c Fri Jan 30 20:47:59 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_die.c,v 1.59 2004/01/27 20:54:44 jsalmon3 Exp $
+// $Id: action_die.c,v 1.60 2004/01/30 09:47:59 nobody_ Exp $
//@{
@@ -82,10 +82,12 @@
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
+ // We have to unmark BEFORE changing the type.
+ // Always do that, since types can have different vision
properties.
MapUnmarkUnitSight(unit);
+ unit->Type = unit->Type->CorpseType;
unit->CurrentSightRange =
unit->Type->Stats[unit->Player->Player].SightRange;
MapMarkUnitSight(unit);
Index: stratagus/src/include/map.h
diff -u stratagus/src/include/map.h:1.119 stratagus/src/include/map.h:1.120
--- stratagus/src/include/map.h:1.119 Tue Jan 27 21:47:45 2004
+++ stratagus/src/include/map.h Fri Jan 30 20:47:59 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: map.h,v 1.119 2004/01/27 10:47:45 wizzard Exp $
+// $Id: map.h,v 1.120 2004/01/30 09:47:59 nobody_ Exp $
#ifndef __MAP_H__
#define __MAP_H__
@@ -521,6 +521,7 @@
MapSight((unit)->Player, (unit)->X,(unit)->Y, (unit)->Type->TileWidth,\
(unit)->Type->TileHeight, (unit)->CurrentSightRange,
MapMarkTileSight); \
if (unit->Type->DetectCloak) { \
+ DebugLevel0Fn("P%d Mark detect cloak at %d, %d\n" _C_
(unit)->Player->Player _C_ (unit)->X _C_ (unit)->Y);\
MapSight((unit)->Player, (unit)->X,(unit)->Y,
(unit)->Type->TileWidth,\
(unit)->Type->TileHeight,
(unit)->CurrentSightRange, MapMarkTileDetectCloak); \
}\
@@ -531,6 +532,7 @@
MapSight((unit)->Player,(unit)->X,(unit)->Y, (unit)->Type->TileWidth,\
(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapUnmarkTileSight); \
if (unit->Type->DetectCloak) { \
+ DebugLevel0Fn("P%d Unmark detect cloak at %d, %d\n" _C_
(unit)->Player->Player _C_ (unit)->X _C_ (unit)->Y);\
MapSight((unit)->Player, (unit)->X,(unit)->Y,
(unit)->Type->TileWidth,\
(unit)->Type->TileHeight,
(unit)->CurrentSightRange, MapUnmarkTileDetectCloak); \
}\
Index: stratagus/src/unit/unit.c
diff -u stratagus/src/unit/unit.c:1.380 stratagus/src/unit/unit.c:1.381
--- stratagus/src/unit/unit.c:1.380 Fri Jan 30 07:36:22 2004
+++ stratagus/src/unit/unit.c Fri Jan 30 20:48:00 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.380 2004/01/29 20:36:22 nobody_ Exp $
+// $Id: unit.c,v 1.381 2004/01/30 09:48:00 nobody_ Exp $
//@{
@@ -2892,6 +2892,7 @@
} else {
unit->CurrentSightRange = 0;
}
+ DebugLevel0Fn("%s\n" _C_ unit->Type->Name);
MapMarkUnitSight(unit);
}
@@ -3769,7 +3770,7 @@
int j;
CLprintf(file, "\n--- -----------------------------------------\n");
- CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.380 2004/01/29
20:36:22 nobody_ Exp $\n\n");
+ CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.381 2004/01/30
09:48:00 nobody_ Exp $\n\n");
#if 0
//
Index: stratagus/src/unit/unit_draw.c
diff -u stratagus/src/unit/unit_draw.c:1.218
stratagus/src/unit/unit_draw.c:1.219
--- stratagus/src/unit/unit_draw.c:1.218 Fri Jan 30 07:36:23 2004
+++ stratagus/src/unit/unit_draw.c Fri Jan 30 20:48:01 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.218 2004/01/29 20:36:23 nobody_ Exp $
+// $Id: unit_draw.c,v 1.219 2004/01/30 09:48:01 nobody_ Exp $
//@{
@@ -644,7 +644,7 @@
{
#if 0
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.218
2004/01/29 20:36:23 nobody_ Exp $\n\n");
+ CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.219
2004/01/30 09:48:01 nobody_ Exp $\n\n");
CLprintf(file, "(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1635,7 +1635,7 @@
const UnitStats* stats;
int r;
-#if 0 // This is for showing vis counts and refs.
+#if 1 // This is for showing vis counts and refs.
char buf[10];
sprintf(buf, "%d%c%c%d", unit->VisCount[ThisPlayer->Player],
unit->Seen.ByPlayer & (1 << ThisPlayer->Player) ? 'Y' : 'N',
Index: stratagus/src/unit/unit_find.c
diff -u stratagus/src/unit/unit_find.c:1.71 stratagus/src/unit/unit_find.c:1.72
--- stratagus/src/unit/unit_find.c:1.71 Thu Jan 29 23:50:37 2004
+++ stratagus/src/unit/unit_find.c Fri Jan 30 20:48:01 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_find.c,v 1.71 2004/01/29 12:50:37 nobody_ Exp $
+// $Id: unit_find.c,v 1.72 2004/01/30 09:48:01 nobody_ Exp $
//@{
@@ -781,9 +781,7 @@
for (i = 0; i < n; ++i) {
dest = table[i];
- // Do NOT check vision.
- if (dest->Removed || dest->Invisible || !unit->HP
- || dest->Orders[0].Action == UnitActionDie) {
+ if (!UnitVisibleOnMap(dest, unit->Player)) {
continue;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src action/action_die.c include/map.h...,
address@hidden <=