(ship_bomb, deli, do_demo, fuel, grin, look_ship)

(ltend, multifire, quite_bigdef, mine, landmine)
(do_loan, prod, printdiff, sell, sona, stre)
(tend, fire_dchrg, vers, work, ac_planedamage)
(ac_shipflak, ask_off, get_mine_dsupport, att_fight)
(ask_move_in_off, detonate, sd, land_gun)
(land_unitgun, lnd_fort_interdiction, lnd_fortify)
(perform_mission, pln_mine, pln_mobcost)
(retreat_ship1, retreat_land1, shp_sweep)
(shp_fort_interdiction, shp_missle_defense)
(new_work, growfood, upd_land, land_repair)
(get_materials, do_mob_ship, do_mob_land)
(load_it, unload_it, prod_plane, produce)
(guerrilla, upd_buildeff, spread_fallout)
(upd_ship, ship_repair, min, dmin, MIN):
Remove min() and dmin() functions and replace
with a MIN macro in misc.h.  Remove local MIN
macros and use the new one in misc.h.  This
change removes the need for the special
case for _WIN32.

(fuel, look_ship, multifire, mission, sona)
(plane_sona, ef_open, player_accept, player_main)
(ac_dog, att_get_combat, calc_mobcost)
(ask_move_in_off, intelligence_report)
(build_mission_list_type, perform_mission)
(show_mission, use_supply, dodistribute)
(allocate_memory, max, dmax, MAX):
Remove max() and dmax() functions and replace
with a MAX macro in misc.h.  Remove local MAX
macros and use the new one in misc.h.  This
change removes the need for the special
case for _WIN32.
This commit is contained in:
Ron Koenderink 2006-01-12 14:23:55 +00:00
parent b89de57d51
commit 04a8b84592
48 changed files with 152 additions and 251 deletions

View file

@ -208,7 +208,7 @@ multifire(void)
continue;
}
gun = item.ship.shp_item[I_GUN];
gun = min(gun, item.ship.shp_glim);
gun = MIN(gun, item.ship.shp_glim);
if (item.ship.shp_frnge == 0) {
pr("Ships %d cannot fire guns!\n", item.ship.shp_uid);
continue;
@ -327,7 +327,7 @@ multifire(void)
continue;
}
gun = fship.shp_item[I_GUN];
gun = min(gun, fship.shp_glim);
gun = MIN(gun, fship.shp_glim);
if (fship.shp_frnge == 0 || gun == 0) {
pr("Insufficient arms.\n");
continue;
@ -358,16 +358,16 @@ multifire(void)
continue;
}
}
gun = min(gun, shell * 2);
gun = min(gun, mil / 2);
gun = max(gun, 1);
gun = MIN(gun, shell * 2);
gun = MIN(gun, mil / 2);
gun = MAX(gun, 1);
shots = gun;
guneff = seagun(fship.shp_effic, shots);
dam = (int)guneff;
shell -= ldround(((double)shots) / 2.0, 1);
fship.shp_item[I_SHELL] = shell;
if (opt_NOMOBCOST == 0)
fship.shp_mobil = max(fship.shp_mobil - 15, -100);
fship.shp_mobil = MAX(fship.shp_mobil - 15, -100);
putship(fship.shp_uid, &fship);
} else if (attacker == targ_unit) {
if (fland.lnd_own != player->cnum) {
@ -840,8 +840,8 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
/* only need 1 shell, so don't check that */
if (shell < 1)
continue;
nshot = min(gun, ship.shp_item[I_MILIT]);
nshot = min(nshot, ship.shp_glim);
nshot = MIN(gun, ship.shp_item[I_MILIT]);
nshot = MIN(nshot, ship.shp_glim);
if (nshot == 0)
continue;
(*nfiring)++;