Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8861) remove unit_behind_*** functions
Home

[Freeciv-Dev] (PR#8861) remove unit_behind_*** functions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8861) remove unit_behind_*** functions
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 May 2004 13:35:35 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8861 >

Vasco discovered there are 4 unused functions in combat.[ch].  They are 
all obsoleted by defense_multiplication().  This patch removes them.

jason

Index: common/combat.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/combat.c,v
retrieving revision 1.42
diff -u -r1.42 combat.c
--- common/combat.c     11 May 2004 17:18:19 -0000      1.42
+++ common/combat.c     28 May 2004 20:34:02 -0000
@@ -308,20 +308,6 @@
 }
 
 /**************************************************************************
- a wrapper function that returns whether or not the unit is on a citysquare
- with citywalls
-**************************************************************************/
-bool unit_behind_walls(struct unit *punit)
-{
-  struct city *pcity;
-  
-  if((pcity=map_get_city(punit->x, punit->y)))
-    return city_got_citywalls(pcity);
-  
-  return FALSE;
-}
-
-/**************************************************************************
  a wrapper function returns 1 if the unit is on a square with fortress
 **************************************************************************/
 bool unit_on_fortress(struct unit *punit)
@@ -330,39 +316,6 @@
 }
 
 /**************************************************************************
- a wrapper function returns 1 if the unit is on a square with coastal defense
-**************************************************************************/
-bool unit_behind_coastal(struct unit *punit)
-{
-  struct city *pcity;
-  if((pcity=map_get_city(punit->x, punit->y)))
-    return city_got_building(pcity, B_COASTAL);
-  return FALSE;
-}
-
-/**************************************************************************
- a wrapper function returns 1 if the unit is on a square with sam site
-**************************************************************************/
-bool unit_behind_sam(struct unit *punit)
-{
-  struct city *pcity;
-  if((pcity=map_get_city(punit->x, punit->y)))
-    return city_got_building(pcity, B_SAM);
-  return FALSE;
-}
-
-/**************************************************************************
- a wrapper function returns 1 if the unit is on a square with sdi defense
-**************************************************************************/
-bool unit_behind_sdi(struct unit *punit)
-{
-  struct city *pcity;
-  if((pcity=map_get_city(punit->x, punit->y)))
-    return city_got_building(pcity, B_SDI);
-  return FALSE;
-}
-
-/**************************************************************************
   a wrapper function returns 1 if there is a sdi-defense close to the square
 **************************************************************************/
 struct city *sdi_defense_close(struct player *owner, int x, int y)
Index: common/combat.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/combat.h,v
retrieving revision 1.11
diff -u -r1.11 combat.h
--- common/combat.h     11 Jan 2004 17:45:03 -0000      1.11
+++ common/combat.h     28 May 2004 20:34:02 -0000
@@ -39,11 +39,7 @@
 double unit_win_chance(struct unit *attacker, struct unit *defender);
 
 bool unit_really_ignores_citywalls(struct unit *punit);
-bool unit_behind_walls(struct unit *punit);
 bool unit_on_fortress(struct unit *punit);
-bool unit_behind_coastal(struct unit *punit);
-bool unit_behind_sam(struct unit *punit);
-bool unit_behind_sdi(struct unit *punit);
 struct city *sdi_defense_close(struct player *owner, int x, int y);
 
 int get_attack_power(struct unit *punit);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8861) remove unit_behind_*** functions, Jason Short <=