Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3699) Goto when trying to move an exhausted unit
Home

[Freeciv-Dev] (PR#3699) Goto when trying to move an exhausted unit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3699) Goto when trying to move an exhausted unit
From: "a-l@xxxxxxx" <a-l@xxxxxxx>
Date: Tue, 11 Mar 2003 10:07:47 -0800
Reply-to: rt@xxxxxxxxxxxxxx

It is nice of the client to issue a single-step goto
when you try to move an exhausted unit with the
direction keys.


Arnstein

--- cvs/client/control.c        Sat Feb 22 10:43:01 2003
+++ movegoto/client/control.c   Tue Mar 11 18:07:11 2003
@@ -692,10 +692,17 @@
     return;
   }
 
-  req_unit = *punit;
-  req_unit.x = dest_x;
-  req_unit.y = dest_y;
-  send_move_unit(&req_unit);
+  if (punit->moves_left > 0) {
+    req_unit = *punit;
+    req_unit.x = dest_x;
+    req_unit.y = dest_y;
+    send_move_unit(&req_unit);
+  }
+  else {
+    /* Nice to give gotos with direction
+       keys for exhausted units. */
+    send_goto_unit(punit, dest_x, dest_y);
+  }
 }
 
 /**************************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#3699) Goto when trying to move an exhausted unit, a-l@xxxxxxx <=