[Freeciv-Dev] Re: [PATCH] Unit movement
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Jan 16, 2001 at 02:59:54PM +0100, Raimar Falke wrote:
> sort_units(); /* to let explorer move before other units */
> for_each_unit
> {
> while(current_unit_can_move())
> {
> think_about_best_direction(); /* could use dry_run */
> result=move();
> /* if dry_run was used before if should succeed */
This is *false*. There is no way to make dry_run reliable,
unless it blocks all activity on the server that could possibly
affect this situation.
Besides, waiting for every move() would be prohibitively slow;
Chuck Corey explained this earlier.
> if(is_enemy_unit_near())
Same remark: you have no way of knowing. On a fast network the best you
can have is a high probablility.
> if(enemy_can_be_killed()) /* is there a unit with attack>0 near
> */
> try_to_kill_it();
> if(is_enemy_unit_near())
> retreat();
> }
> }
I think you should abandon the thought of structuring your code in this
way, unless it runs in the server (where such loops *are* possible).
--
Reinier
- [Freeciv-Dev] Re: [PATCH] Unit movement, (continued)
- [Freeciv-Dev] Re: [PATCH] Unit movement, ccrayne, 2001/01/15
- [Freeciv-Dev] Re: [PATCH] Unit movement, Reinier Post, 2001/01/16
- [Freeciv-Dev] Re: [PATCH] Unit movement, ccrayne, 2001/01/16
- [Freeciv-Dev] Re: [PATCH] Unit movement, ccrayne, 2001/01/15
- [Freeciv-Dev] Re: [PATCH] Unit movement, Raimar Falke, 2001/01/15
- [Freeciv-Dev] Re: [PATCH] Unit movement, Gerhard Killesreiter, 2001/01/16
- [Freeciv-Dev] Re: [PATCH] Unit movement, Raimar Falke, 2001/01/16
- [Freeciv-Dev] Re: [PATCH] Unit movement,
Reinier Post <=
- [Freeciv-Dev] Re: [PATCH] Unit movement, Raimar Falke, 2001/01/16
- [Freeciv-Dev] Re: [PATCH] Unit movement, Jeff Mallatt, 2001/01/15
|
|