[Freeciv-Dev] Re: Connect feature - version #4
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
At 1999/12/25 21:51 , Jarda Benkovsky wrote:
>here's (hopefully final) version of Connect feature.
I've attached an expanded patch, which includes all your changes plus the
following changes:
- In your new get_activity_text(), there's no need to copy the return to a
static buffer. In fact, it's better to not do so. The pointer returned
from _("String literal.") will remain valid forever (well, as least as far
as we're concerned for now).
- In the callbacks for the new "Choose unit activity:" dialogs (xaw and
gtk), you used a pointer to a unit that was cached when the dialog was
created. In the case where an enemy killed the unit between when the
dialog was created and the player selected an activity, the pointer to the
unit would be invalid in the callback. So, in these cases we should cache
the unit ID, and look up the unit by ID in the callbacks (like in the
Pillage dialog code).
- I changed the goto route planner slightly to handle a new concept: "goto
move restrictions". For any call to do_unit_goto(), you can specify that
the move be chosen as it has been (unrestricted), or that the move be
restricted to a cardinal direction (N/S/E/W only), or that a "straight as
possible" move to the destination be preferred. Then, in the case where
the player has commanded a Connect, I use the "straight as possible" move
for everything except Irrigation, in which case I use the cardinal
direction only move. This (to me) makes roads much nicer, and allows
irrigation to work in all reasonable cases.
This has also be updated to patch cleanly against the latest CVS.
settlers-connect-4.diff.gz
Description: Binary data
jjm
|
|