[Freeciv-Dev] Re: (PR#14968) Wrong number of turns displayed for movemen
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14968 >
Guillaume Melquiond wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=14968 >
>
> Due to a patch committed on December 23th, the number of turns needed
> to move a unit is incorrectly displayed in the GTK2 client. To
> reproduce, start a game, select one of your units, and move your
> cursor around the map. The client will correctly draw the shortest
> path to reach this destination, but the turn count will be completely
> random.
A stupid mistake, though it's odd that gcc wouldn't report an error here.
-jason
Index: tilespec.c
===================================================================
--- tilespec.c (revision 11381)
+++ tilespec.c (working copy)
@@ -3860,12 +3860,12 @@
return 0;
}
if (ptile && ptile == get_line_dest()) {
- int length;
- int units = length % NUM_TILES_DIGITS;
- int tens = (length / 10) % NUM_TILES_DIGITS;
+ int length, units, tens;
goto_get_turns(NULL, &length);
- if (length >= 100) {
+ units = length % NUM_TILES_DIGITS;
+ tens = (length / 10) % NUM_TILES_DIGITS;
+ if (length < 0 || length >= 100) {
static bool reported = FALSE;
if (!reported) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#14968) Wrong number of turns displayed for movement,
Jason Short <=
|
|