[Freeciv-Dev] Re: New AI cleanups (PR#1360)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I moved the assert after freelog as you asked, and changed comments. Take a
look. I have made no other formatting changes because I don't want emails from
Mike.
I've included both patches in the one email.
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/ diff -ruN -Xdiff_ignore cvs-freeciv/ai/aiunit.c freeciv/ai/aiunit.c
--- cvs-freeciv/ai/aiunit.c Thu Apr 4 16:04:59 2002
+++ freeciv/ai/aiunit.c Thu Apr 4 17:00:45 2002
@@ -160,17 +160,18 @@
path1 costs: first tile = 3, second tile = 2
- turn 0: points=2, unit has to wait
- turn 1: points=3, unit can move, points=0, has to wait
- turn 2: points=3, unit can move, points=1
+ turn 0: points = 2, unit has to wait
+ turn 1: points = 3, unit can move, points = 0, has to wait
+ turn 2: points = 3, unit can move, points = 1
- path2 costs: first tile=2, second tile=3
+ path2 costs: first tile = 2, second tile = 3
- turn 0: points=2, unit can move, points=0, has to wait
- turn 1: points=3, unit can move, points=0
+ turn 0: points = 2, unit can move, points = 0, has to wait
+ turn 1: points = 3, unit can move, points = 0
- In spite of the path costs being the same, these two units will arrive
- at different times. This function also does not take into account ZOC.
+ In spite of the path costs being the same, units that take a path of the
+ same length will arrive at different times. This function also does not
+ take into account ZOC or lack of hp affecting movement.
Note: even if a unit has only fractional move points left, there is
still a possibility it could cross the tile.
@@ -219,9 +220,9 @@
break;
default:
- assert(0);
freelog(LOG_FATAL, "In ai/aiunit.c: function unit_move_turns");
freelog(LOG_FATAL, "Illegal move type %d", unit_type(punit)->move_type);
+ assert(0);
exit(EXIT_FAILURE);
move_time = -1;
}
diff -ruN -Xdiff_ignore cvs-freeciv/common/unit.c freeciv/common/unit.c
--- cvs-freeciv/common/unit.c Thu Apr 4 16:04:59 2002
+++ freeciv/common/unit.c Thu Apr 4 17:06:43 2002
@@ -33,9 +33,12 @@
#include "speclist_c.h"
/***************************************************************
-Unit move rate calculates the move rate of the unit taking into
-account the penalty for reduced hitpoints (affects sea and land units
-only) and the effects of wonders for sea units. --RK
+This function calculates the move rate of the unit taking into
+account the penalty for reduced hitpoints (affects sea and land
+units only) and the effects of wonders for sea units.
+
+FIXME: Use generalised improvements code instead of hardcoded
+wonder effects --RK
***************************************************************/
int unit_move_rate(struct unit *punit)
{
@@ -72,9 +75,9 @@
break;
default:
- assert(0);
freelog(LOG_FATAL, "In common/unit.c: function unit_move_rate");
freelog(LOG_FATAL, "Illegal move type %d", unit_type(punit)->move_type);
+ assert(0);
exit(EXIT_FAILURE);
move_rate = -1;
}
|
|