Author: cazfi
Date: Sun Apr 17 06:07:39 2016
New Revision: 32426

URL: http://svn.gna.org/viewcvs/freeciv?rev=32426&view=rev
Log:
Renamed unit_alive() as unit_is_alive()

See patch #7108

Modified:
    branches/S2_6/ai/default/aiferry.c
    branches/S2_6/common/unit.c
    branches/S2_6/common/unit.h
    branches/S2_6/server/diplomats.c
    branches/S2_6/server/unithand.c
    branches/S2_6/server/unittools.c

Modified: branches/S2_6/ai/default/aiferry.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/default/aiferry.c?rev=32426&r1=32425&r2=32426&view=diff
==============================================================================
--- branches/S2_6/ai/default/aiferry.c  (original)
+++ branches/S2_6/ai/default/aiferry.c  Sun Apr 17 06:07:39 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 2004 - The Freeciv Project
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -682,7 +682,7 @@
          * ferry to die. That has happened at least when passenger
          * destroyed city cutting the civ1-style channel (cities in
          * a chain) ferry was in. */
-       if (unit_alive(ferry_id) && 0 < ferry->moves_left
+       if (unit_is_alive(ferry_id) && 0 < ferry->moves_left
             && (!alive || unit_tile(ferry) != unit_tile(passenger))) {
          /* The passenger is no longer on the ferry,
           * and the ferry can still act.

Modified: branches/S2_6/common/unit.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/unit.c?rev=32426&r1=32425&r2=32426&view=diff
==============================================================================
--- branches/S2_6/common/unit.c (original)
+++ branches/S2_6/common/unit.c Sun Apr 17 06:07:39 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2183,9 +2183,9 @@
 
 /**************************************************************************
   Check if unit with given id is still alive. Use this before using
-  old unit pointers when unit might have dead.
-**************************************************************************/
-bool unit_alive(int id)
+  old unit pointers when unit might have died.
+**************************************************************************/
+bool unit_is_alive(int id)
 {
   /* Check if unit exist in game */
   if (game_unit_by_number(id)) {

Modified: branches/S2_6/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/unit.h?rev=32426&r1=32425&r2=32426&view=diff
==============================================================================
--- branches/S2_6/common/unit.h (original)
+++ branches/S2_6/common/unit.h Sun Apr 17 06:07:39 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -372,7 +372,7 @@
 bool unit_type_is_losing_hp(const struct player *pplayer,
                             const struct unit_type *punittype);
 
-bool unit_alive(int id);
+bool unit_is_alive(int id);
 
 void *unit_ai_data(const struct unit *punit, const struct ai_type *ai);
 void unit_set_ai_data(struct unit *punit, const struct ai_type *ai,

Modified: branches/S2_6/server/diplomats.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/diplomats.c?rev=32426&r1=32425&r2=32426&view=diff
==============================================================================
--- branches/S2_6/server/diplomats.c    (original)
+++ branches/S2_6/server/diplomats.c    Sun Apr 17 06:07:39 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -512,7 +512,7 @@
   action_consequence_success(ACTION_SPY_BRIBE_UNIT, pplayer, uplayer,
                              victim_tile, victim_link);
 
-  if (!unit_alive(diplomat_id)) {
+  if (!unit_is_alive(diplomat_id)) {
     return;
   }
 
@@ -521,7 +521,7 @@
   if (NULL == pcity && unit_list_size(unit_tile(pvictim)->units) < 2
       && !unit_move_handling(pdiplomat, victim_tile, FALSE, FALSE)
       /* May have died while trying to move. */
-      && unit_alive(diplomat_id)) {
+      && unit_is_alive(diplomat_id)) {
     pdiplomat->moves_left = 0;
   }
   if (NULL != player_unit_by_number(pplayer, diplomat_id)) {

Modified: branches/S2_6/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unithand.c?rev=32426&r1=32425&r2=32426&view=diff
==============================================================================
--- branches/S2_6/server/unithand.c     (original)
+++ branches/S2_6/server/unithand.c     Sun Apr 17 06:07:39 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1142,7 +1142,7 @@
                             API_TYPE_ACTION, action_by_number(action),    \
                             API_TYPE_UNIT, actor,                         \
                             API_TYPE_CITY, target);                       \
-  if (!actor || !unit_alive(actor_id)) {                                  \
+  if (!actor || !unit_is_alive(actor_id)) {                               \
     /* Actor unit was destroyed during pre action Lua. */                 \
     return;                                                         \
   }                                                                       \
@@ -1156,11 +1156,11 @@
                             API_TYPE_ACTION, action_by_number(action),    \
                             API_TYPE_UNIT, actor,                         \
                             API_TYPE_UNIT, target);                       \
-  if (!actor || !unit_alive(actor_id)) {                                  \
+  if (!actor || !unit_is_alive(actor_id)) {                               \
     /* Actor unit was destroyed during pre action Lua. */                 \
     return;                                                         \
   }                                                                       \
-  if (!target || !unit_alive(target_id)) {                                \
+  if (!target || !unit_is_alive(target_id)) {                             \
     /* Target unit was destroyed during pre action Lua. */                \
     return;                                                         \
   }
@@ -2191,7 +2191,7 @@
     punit->moved = TRUE;       /* We moved */
     kill_unit(pwinner, ploser,
               vet && !uclass_has_flag(unit_class_get(punit), UCF_MISSILE));
-    if (unit_alive(winner_id)) {
+    if (unit_is_alive(winner_id)) {
       if (uclass_has_flag(unit_class_get(pwinner), UCF_MISSILE)) {
         wipe_unit(pwinner, ULR_MISSILE, NULL);
         return;
@@ -3152,7 +3152,7 @@
 
     unit_move_handling(pcargo, ttile, FALSE, FALSE);
 
-    if (!unit_alive(id)) {
+    if (!unit_is_alive(id)) {
       return;
     }
   }

Modified: branches/S2_6/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unittools.c?rev=32426&r1=32425&r2=32426&view=diff
==============================================================================
--- branches/S2_6/server/unittools.c    (original)
+++ branches/S2_6/server/unittools.c    Sun Apr 17 06:07:39 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3175,7 +3175,7 @@
   if (tocity) {
     unit_enter_city(punit, tocity, passenger);
 
-    alive = unit_alive(saved_id);
+    alive = unit_is_alive(saved_id);
     if (alive) {
       /* In case script has changed something about unit */
       pplayer_end_pos = unit_owner(punit);
@@ -3683,7 +3683,7 @@
       act_player = unit_owner(act_unit);
 
       if (act_unit == NULL
-          || !unit_alive(act_unit->id)) {
+          || !unit_is_alive(act_unit->id)) {
         /* The unit died before reaching this point. */
         continue;
       }
@@ -3758,7 +3758,7 @@
                               API_TYPE_UNIT, punit,
                               API_TYPE_TILE, psrctile,
                               API_TYPE_TILE, pdesttile);
-    unit_lives = unit_alive(saved_id);
+    unit_lives = unit_is_alive(saved_id);
   }
 
   if (unit_lives) {
@@ -3770,7 +3770,7 @@
     /* Is there a hut? */
     if (tile_has_cause_extra(pdesttile, EC_HUT)) {
       unit_enter_hut(punit);
-      unit_lives = unit_alive(saved_id);
+      unit_lives = unit_is_alive(saved_id);
     }
   }
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to