satdisp_sect() and satdisp_units().
(satmap): Call only satdisp_sect(). No functional change.
(aircombat): Call both, and call satdisp_units() even over sea. This
lets spy planes spot surface ships at sea. Closes#906035.
true.
(shp_nav_one_sector): Pass false. This lets minesweepers move at the
speed their stats indicate. Closes#1498801.
(navi): Pass true. This ensures sweeping without moving still costs
mobility.
(empth_init_signals): New, factored out of start_server(). Call from
empth_init().
(panic): Move to posix.c, internal linkage.
(empth_obj): Add new posix.o
(empth_start, empth_alarm) [EMPTH_POSIX]: Clean up pointless messing
with signal handlers.
(empth_init, empth_wakeup) [EMPTH_POSIX]: Clean up a bit.
member p_effic by sctstr member d_peffic. Tables updated.
(show_sect_capab): Adapted.
(prod_eff): Adapted; requires changing first parameter to sector type.
Callers changed.
(P_MDUST): Remove, because pchr[P_MDUST] now identical to
pchr[P_DUST].
(feed_ship, feed_land): Use it.
(do_feed): Use it. Estimate of food needed was one too large for
integer food needs. Used to round fractional food need to nearest
instead of up for supply_commod(), which could cause starvation.
(s_commod, get_minimum): Use it. Estimate of food needed was one too
large for integer food needs. s_commod() used to reserve one more
than get_minimum() would have returned; it's now the same.
(famine_victims): New.
(feed_people): Use it. This rounds victim fractions down instead of
up. It also dosn't flush needs <=1 to zero. Doesn't change
starvation, as do_feed() always produces at least one emergency food.
Does change food consumption.
(starve_some): New.
(feed_people): Use it.
(feed_ship): Use feed_people(). This rounds victim fractions down
instead of up.
(feed_land): Use feed_people(). Rounding of victim fractions
unchanged. Feeds all people not just mil; closes#913997.
(starv_people): New.
(starv_sects, starv_ships, starv_units): Use it. Fixes starve land to
talk about people instead of mil.
(starv_sects): Use famine_victims() rather than feed_people(). Take
emergency food into account, because feed_people() doesn't. Don't aim
for one extra food, for consistency with starv_ships() and
starv_units().
(feed_people): Remove useless parameter. Simplify.
(starv_ships, starv_ships): Use famine_victims() rather than
feed_ship() and feed_land().
(feed_ship, feed_land): Remove useless parameters. Internal linkage.
Simplify.
(feed_land): Call resupply_commod() only if there's a food shortage.
Don't scrounge lnd_ship for food, resupply_commod() already does.
(use_ammo, eta_calc, torp, fire_torp, perform_mission, retreat_ship1)
(shp_sweep, shp_nav_one_sector, cost_ship): Use it.
(perform_mission): Fix mobility cost of torpedo: charged full sector
cost instead of half.
airburst. Leave taking nuke off the plane to caller. Use coord for
coordinate parameters.
(pln_damage): Take nuke off the plane.
(detonate): Destroy the nuke. This is required since arming doesn't
remove nukes from the nuke file anymore (arm.c rev. 1.15).
(nati, populace): Use it.
(populace, nati): Change hap, pct from float to double, because they
are used as double.
(nati): Print happiness needed with just two decimals, like the other
levels.
(nukstr): Hold one nuke instead of a stockpile: replace members nuk_n,
nuk_types by nuk_type, nuk_plane. Add nuk_land for completeness, like
nuk_ship it's not yet used.
(nuke_ca): Update accordingly: replace selectors number and types by
type and plane.
(build_nuke): Update accordingly.
(ndump, nuke): Update accordingly. Output is no longer sorted by
location, and nukes in same location no longer share id. nuke's extra
columns for nuclear plants are repeated for every nuke.
(trade_desc): Update accordingly.
(cede, grab_sect, check_nuke_ok, detonate, trade_nameof): Talk about
nukes instead of nuclear stockpiles.
(arm, disarm): Rewrite, split off new disarm(). Don't remove nuke
from the nuke file on arm. Allow usual plane syntax, not just plane
number. Change second argument from nuke type to nuke number. When
plane is already armed, ignore nuke argument and rearm (broken in
4.2.6).
(tran_nuke): Update for changed struct nukstr, make as similar as
possible to tran_plane. Change syntax to match transport plane.
(player_coms): Update arm, disarm and transport accordingly.
(prnuke, nuk_on_plane): New.
(nuk_add, nuk_delete): Stockpile management, remove.
player can send whatever he wants. Banning IPs is better done with a
packet filter. That leaves restricting deity IPs.
(privip): New econfig key to restrict deity IPs.
(may_play): Implement it.
(match_user): Unused, remove.
(subst.in): Substitute it. Fix prerequisites.
(read_builtin_tables): New.
(main): Call it. This doesn't do anything, because no builtin tables
have been defined.
(config_tables): New econfig key.
(read_config_tables): New, implements config_tables.
(main): Call it. Need to call ef_init() and chdir(configdir) first.
(ef_init_srv): Don't call ef_init(), since main() did it already.
Remove old way to do the same:
(ef_load): Remove, along with calls.
(empfile): Set configuration tables' member file back to NULL.
(shp_check_nav, sail_nav_fleet, bigcity_dchr[], sector_navigation[])
(d_navigation): Add a NEW d_navigation enum NAV_CANAL to
indicate that a sector has canal capability. Add canal determination
logic to shp_check_nav(). Update sector_navigation[] with new
canal navigation enum. Use shp_check_nav() to determine the
sector can be navigated.
(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.
(tcp_listen, player_addrlen): New. IPv4-only code factored out of
player_init().
(player_init): Use them.
(player_accept): Address family independence.
(tcp_connect): New.
(main): Use it.
(hostaddr, hostconnect, hostport): Internal linkage.
Move assignment of hostaddr and hostname from player_new() to
player_accept(). This solves the necessary of adding the socket include
file to prototypes.h for player_new(). The socket include file creates
a namespace conflict for WIN32.