Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#9552) Bug: Air units sentry
Home

[Freeciv-Dev] (PR#9552) Bug: Air units sentry

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#9552) Bug: Air units sentry
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 Nov 2004 00:35:28 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [chrisk - Fri Jul 30 07:47:24 2004]:
> 
> 
> CVS 30 JUL 2004 GTK2
> 
> It is possible to sentry air units (missiles in this case) on places
> (carrier on the ocean in this case) where they can't live and go out of
> fuel. This is irritating.
> 
> Since the current implementation of load/unload does not load sentried
units
> automatically, this isn't useful at all.

Indeed.

I thought of just changing the client to not let it do this.  But on
reflection I think we can just have this as a game rule: units are not
allowed to sentry or remain sentried on tiles that they will die on.

This patch makes that change.  Can you confirm that the behavior is better?

Note that can_unit_survive_at_tile should return FALSE for units on
dangerous terrain or tririemes away from safe coast.  However this is
not implemented.  Perhaps it should be.

jason

Index: common/unit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v
retrieving revision 1.220
diff -u -r1.220 unit.c
--- common/unit.c       18 Oct 2004 22:40:02 -0000      1.220
+++ common/unit.c       20 Nov 2004 08:33:48 -0000
@@ -923,6 +923,10 @@
            && !is_ocean(ptile->terrain));
 
   case ACTIVITY_SENTRY:
+    if (!can_unit_survive_at_tile(punit, punit->tile)) {
+      /* Don't let units sentry on tiles they will die on. */
+      return FALSE;
+    }
     return TRUE;
 
   case ACTIVITY_RAILROAD:

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9552) Bug: Air units sentry, Jason Short <=