[Freeciv-Dev] Re: Changing City Variables
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
YaChu Yang wrote:
What I mean is that using say the following:
+ city_list_iterate(game.player_ptr->cities, pcity) {
+ freelog(LOG_NORMAL, "Original food stock is: %d", pcity->food_stock);
+ pcity->food_stock = 10;
+ freelog(LOG_NORMAL, "New food stock is: %d", pcity->food_stock);
+ } city_list_iterate_end;
The above will get food stock for a particular city and then set food stock to
10. However using the above method, it only updates the local copy of food
stock. Hence in the next turn, my food stock won't be 10 for this particular
city, it'll be the original value plus the amount it's suppose to increase by
per turn.
Freeciv uses a client-server architecture, and the server holds the
master copy of all data. If you put the above code in the server it
will make the change you want. If you put it in the client it will do
nothing.
-jason
|
|