Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10521) sentrying/activating shouldn't load/unload
Home

[Freeciv-Dev] (PR#10521) sentrying/activating shouldn't load/unload

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10521) sentrying/activating shouldn't load/unload
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Oct 2004 15:38:56 -0700
Reply-to: rt@xxxxxxxxxxx

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

This patch changes the behavior that I've been discussing changing for a 
while.  Currently "sentry" loads a unit and "activate" unloads.  This 
patch changes that.  So the canonical way to load and unload is via the 
(l)oad and (u)nload commands.

See also PR#10517.

jason

Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.144
diff -u -r1.144 control.c
--- client/control.c    12 Oct 2004 16:42:12 -0000      1.144
+++ client/control.c    13 Oct 2004 22:37:18 -0000
@@ -859,33 +859,10 @@
 **************************************************************************/
 void request_new_unit_activity(struct unit *punit, enum unit_activity act)
 {
-  struct unit *ptrans;
-
   if (!can_client_issue_orders()) {
     return;
   }
 
-  /* Load or unload the unit depending on the new activity.  Don't call
-   * request_unit_load or request_unit_unload since this can give a
-   * recursive loop. */
-  switch (act) {
-  case ACTIVITY_IDLE:
-    ptrans = find_unit_by_id(punit->transported_by);
-    if (can_unit_unload(punit, ptrans)
-       && can_unit_survive_at_tile(punit, punit->tile)) {
-      dsend_packet_unit_unload(&aconnection, punit->id, ptrans->id);
-    }
-    break;
-  case ACTIVITY_SENTRY:
-    ptrans = find_transporter_for_unit(punit, punit->tile);
-    if (can_unit_load(punit, ptrans)) {
-      dsend_packet_unit_load(&aconnection, punit->id, ptrans->id);
-    }
-    break;
-  default:
-    break;
-  }
-
   dsend_packet_unit_change_activity(&aconnection, punit->id, act,
                                    S_NO_SPECIAL);
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10521) sentrying/activating shouldn't load/unload, Jason Short <=