Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2000:
[Freeciv-Dev] [patch] make sure that the happiness of a city shown in th
Home

[Freeciv-Dev] [patch] make sure that the happiness of a city shown in th

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] [patch] make sure that the happiness of a city shown in the client is current
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Tue, 11 Apr 2000 22:22:08 +0200

To see what I am talking about: take a city under republic, without
police station. Build 2 attack units. move them out of the city in one
turn. Now they should cause disorder in the city, but you don't see any
change. You first see it when the city is updated between turns.

This patch does:
Creates a function
int handle_unit_move_consequences(struct unit *punit, int src_x, int
src_y, int dest_x, int dest_y)
which should called whenever a unit changes tile. It
1) moves the units sight points
2) handles any huts meet
3) awakens any sentried units that should be awakened
4) calls handle_unit_enter_city which hanles hostile takeovers of cities
5) updates and sends the cities affected by the movement

The patch also makes sure that server_remove_unit updates the relevant
city.

Perhaps the linking and unlinking of units should be moved down into
handle_unit_move_consequences too.

-Thue

ps: We can spare a few city sends by doing some checking against the
government . Also, the units still isn't allways displayed right, as they
sometimes doesn't show the angry face when they in fact cause disorder.
This should also go into handle_unit_move_consequences...



[Prev in Thread] Current Thread [Next in Thread]