Only in freeciv: always_allow_setting_activity.patch diff -u -r freecivold/common/unit.c freeciv/common/unit.c --- freecivold/common/unit.c Thu Jan 20 12:50:55 2000 +++ freeciv/common/unit.c Sun Feb 20 22:48:11 2000 @@ -932,12 +932,11 @@ switch(activity) { case ACTIVITY_POLLUTION: - return unit_flag(punit->type, F_SETTLERS) && punit->moves_left && - (ptile->special&S_POLLUTION); + return unit_flag(punit->type, F_SETTLERS) && (ptile->special&S_POLLUTION); case ACTIVITY_ROAD: return terrain_control.may_road && - unit_flag(punit->type, F_SETTLERS) && punit->moves_left && + unit_flag(punit->type, F_SETTLERS) && !(ptile->special&S_ROAD) && ptile->terrain!=T_OCEAN && ((ptile->terrain!=T_RIVER && !(ptile->special&S_RIVER)) || player_knows_techs_with_flag(pplayer, TF_BRIDGE)); @@ -946,7 +945,7 @@ /* Don't allow it if someone else is irrigating this tile. * *Do* allow it if they're transforming - the mine may survive */ if (terrain_control.may_mine && - unit_flag(punit->type, F_SETTLERS) && punit->moves_left && + unit_flag(punit->type, F_SETTLERS) && type->mining_result!=T_LAST && !(ptile->special&S_MINE)) { unit_list_iterate(ptile->units, tunit) { if(tunit->activity==ACTIVITY_IRRIGATE) return 0; @@ -959,7 +958,7 @@ /* Don't allow it if someone else is mining this tile. * *Do* allow it if they're transforming - the irrigation may survive */ if (terrain_control.may_irrigate && - unit_flag(punit->type, F_SETTLERS) && punit->moves_left && + unit_flag(punit->type, F_SETTLERS) && (!(ptile->special&S_IRRIGATION) || (!(ptile->special&S_FARMLAND) && player_knows_techs_with_flag(pplayer, TF_FARMLAND))) && @@ -979,12 +978,12 @@ !unit_flag(punit->type, F_SETTLERS); case ACTIVITY_FORTRESS: - return unit_flag(punit->type, F_SETTLERS) && punit->moves_left && + return unit_flag(punit->type, F_SETTLERS) && player_knows_techs_with_flag(pplayer, TF_FORTRESS) && !(ptile->special&S_FORTRESS) && ptile->terrain!=T_OCEAN; case ACTIVITY_AIRBASE: - return unit_flag(punit->type, F_AIRBASE) && punit->moves_left && + return unit_flag(punit->type, F_AIRBASE) && player_knows_techs_with_flag(pplayer, TF_AIRBASE) && !(ptile->special&S_AIRBASE) && ptile->terrain!=T_OCEAN; @@ -994,7 +993,7 @@ case ACTIVITY_RAILROAD: /* if the tile has road, the terrain must be ok.. */ return terrain_control.may_road && - unit_flag(punit->type, F_SETTLERS) && punit->moves_left && + unit_flag(punit->type, F_SETTLERS) && ((ptile->special&S_ROAD) || (punit->connecting && (ptile->terrain!=T_OCEAN && ((ptile->terrain!=T_RIVER && !(ptile->special&S_RIVER)) @@ -1007,7 +1006,7 @@ int pspresent; int psworking; pspresent = get_tile_infrastructure_set(ptile); - if (pspresent && is_ground_unit(punit) && punit->moves_left) { + if (pspresent && is_ground_unit(punit)) { psworking = get_unit_tile_pillage_set(punit->x, punit->y); if (target == S_NO_SPECIAL) return ((pspresent & (~psworking)) != 0); diff -u -r freecivold/server/plrhand.c freeciv/server/plrhand.c --- freecivold/server/plrhand.c Wed Feb 16 12:54:15 2000 +++ freeciv/server/plrhand.c Sun Feb 20 21:35:32 2000 @@ -1337,7 +1337,7 @@ notify_player(pplayer, _("Year: %s"), textyear(game.year)); great_library(pplayer); update_revolution(pplayer); - player_restore_units(pplayer); + player_restore_units(pplayer); /*note: restoring move point moved to update_unit_activities*/ update_city_activities(pplayer); #ifdef CITIES_PROVIDE_RESEARCH if (city_list_size(&pplayer->cities)) /* has to be below the above for got_tech */ diff -u -r freecivold/server/unitfunc.c freeciv/server/unitfunc.c --- freecivold/server/unitfunc.c Sun Feb 6 12:52:49 2000 +++ freeciv/server/unitfunc.c Sun Feb 20 21:34:27 2000 @@ -1227,7 +1227,7 @@ } /*************************************************************************** -Restore unit move points and hitpoints. +Restore unit hitpoints. (movepoint - restoration moved to update_unit_activities) Do Leonardo's Workshop upgrade if applicable. Now be careful not to strand units at sea with the Workshop. --dwp Adjust air units for fuel: air units lose fuel unless in a city, @@ -1283,7 +1283,6 @@ unit_list_iterate(pplayer->units, punit) { unit_restore_hitpoints(pplayer, punit); - unit_restore_movepoints(pplayer, punit); if(punit->hp<=0) { /* This should usually only happen for heli units, @@ -1756,6 +1755,7 @@ progress settlers in their current tasks, and units that is pillaging. also move units that is on a goto. + restore unit move points (information needed for settler tasks) **************************************************************************/ void update_unit_activity(struct player *pplayer, struct unit *punit) { @@ -1765,12 +1765,19 @@ int activity = punit->activity; + /* to allow a settler to begin a task with no moves left without it counting toward the time to finish */ + if (punit->moves_left){ + punit->activity_count += mr/3; + } + + unit_restore_movepoints(pplayer, punit); + if (punit->connecting && !can_unit_do_activity(punit, activity)) { punit->activity_count = 0; do_unit_goto (pplayer, punit, get_activity_move_restriction(activity)); } - punit->activity_count += mr/3; + /* if connecting, automagically build prerequisities first */ if (punit->connecting && activity == ACTIVITY_RAILROAD && !(map_get_tile(punit->x, punit->y)->special & S_ROAD)) {