[freeciv-ai] Re: [Freeciv-Dev] (PR#3395) Explore
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 12 Feb 2003, ChrisK@xxxxxxxx via RT wrote:
> CVS 12 FEB 2003 GTK 1.2
>
> When everything is explored a ship can explore, you still
> can give X command to ships (or use menue); the unit then shows
> a "A" instead of "X". The "A" disappears after turn done.
Cause: missing send_unit_info in unithand.c
Cure: randomly rearrange code
also fixes a potential problem when server was sending info about an
already dead and dismembered unit.
G.
? gmon.out
? mmm.gz
? new_explorer_profile.txt
? old_explorer_profile.txt
? omni.gz
? relax.gz
? ttt.gz
Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.252
diff -u -r1.252 unithand.c
--- server/unithand.c 2003/02/04 23:12:31 1.252
+++ server/unithand.c 2003/02/12 12:42:06
@@ -636,10 +636,10 @@
/* ai_manage_explorer sets the activity to idle, so we reset
* it. */
set_unit_activity(punit, ACTIVITY_EXPLORE);
- send_unit_info(NULL, punit);
} else {
punit->ai.control = FALSE;
}
+ send_unit_info(NULL, punit);
}
}
}
Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.210
diff -u -r1.210 unittools.c
--- server/unittools.c 2003/02/10 21:43:43 1.210
+++ server/unittools.c 2003/02/12 12:42:06
@@ -737,12 +737,17 @@
if (activity == ACTIVITY_EXPLORE) {
bool more_to_explore = ai_manage_explorer(punit);
- if (more_to_explore && player_find_unit_by_id(pplayer, id)) {
- handle_unit_activity_request(punit, ACTIVITY_EXPLORE);
- } else {
- send_unit_info(NULL, punit);
+
+ if (!player_find_unit_by_id(pplayer, id)) {
+ /* Died */
return;
}
+
+ if (more_to_explore) {
+ handle_unit_activity_request(punit, ACTIVITY_EXPLORE);
+ }
+ send_unit_info(NULL, punit);
+ return;
}
if (activity==ACTIVITY_PILLAGE) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freeciv-ai] Re: [Freeciv-Dev] (PR#3395) Explore,
Gregory Berkolaiko via RT <=
|
|