--- ../tmp/freeciv/server/unitfunc.c Sat Jun 17 06:21:23 2000 +++ server/unitfunc.c Sat Jun 17 17:28:40 2000 @@ -1629,39 +1629,29 @@ **************************************************************************/ void unit_versus_unit(struct unit *attacker, struct unit *defender) { - int attackpower = get_total_attack_power(attacker,defender); - int defensepower = get_total_defense_power(attacker,defender); - int attack_firepower = get_unit_type(attacker->type)->firepower; - int defense_firepower = get_unit_type(defender->type)->firepower; - - /* pearl harbour */ - if (is_sailing_unit(defender) && map_get_city(defender->x, defender->y)) - defense_firepower = 1; - - /* In land bombardment both units have their firepower reduced to 1 */ - if (is_sailing_unit(attacker) - && map_get_terrain(defender->x, defender->y) != T_OCEAN - && is_ground_unit(defender)) { - attack_firepower = 1; - defense_firepower = 1; - } + int attackpower=get_total_attack_power(attacker,defender); + int defensepower=get_total_defense_power(attacker,defender); - freelog(LOG_VERBOSE, "attack:%d, defense:%d, attack firepower:%d, defense firepower:%d", - attackpower, defensepower, attack_firepower, defense_firepower); + freelog(LOG_VERBOSE, "attack:%d, defense:%d", attackpower, defensepower); if (!attackpower) { attacker->hp=0; } else if (!defensepower) { defender->hp=0; } while (attacker->hp>0 && defender->hp>0) { - if (myrand(attackpower+defensepower) >= defensepower) { - defender->hp -= attack_firepower * game.firepower_factor; + if (myrand(attackpower+defensepower)>= defensepower) { + defender->hp -= get_unit_type(attacker->type)->firepower + * game.firepower_factor; } else { - attacker->hp -= defense_firepower * game.firepower_factor; + if (is_sailing_unit(defender) && map_get_city(defender->x, defender->y)) + attacker->hp -= game.firepower_factor; /* pearl harbour */ + else + attacker->hp -= get_unit_type(defender->type)->firepower + * game.firepower_factor; } } - if (attacker->hp<0) attacker->hp = 0; - if (defender->hp<0) defender->hp = 0; + if (attacker->hp<0) attacker->hp=0; + if (defender->hp<0) defender->hp=0; if (attacker->hp) maybe_make_veteran(attacker); @@ -2228,6 +2218,7 @@ " land to sea at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); move_unit(punit2, x, y, 1, 0, 0); + punit2->activity = ACTIVITY_IDLE; goto START; } } @@ -2251,6 +2242,7 @@ " land to sea at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); move_unit(punit2, x, y, 1, 0, 0); + punit2->activity = ACTIVITY_IDLE; goto START; } } @@ -2294,6 +2286,7 @@ " sea to land at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); move_unit(punit2, x, y, 1, 1, 0); + punit2->activity = ACTIVITY_IDLE; goto START; } } @@ -2317,6 +2310,7 @@ " sea to land at (%d, %d)."), unit_name(punit2->type), punit2->x, punit2->y); move_unit(punit2, x, y, 1, 1, 0); + punit2->activity = ACTIVITY_IDLE; goto START; } }