empserver
16 years agoThe previous revision of Make.mk didn't work with separate build v4.3.4
Markus Armbruster [Thu, 25 May 2006 08:18:20 +0000 (08:18 +0000)]
The previous revision of Make.mk didn't work with separate build
trees.  Do it in a way that does.

16 years ago4.3.4 last minute changes.
Markus Armbruster [Thu, 25 May 2006 05:48:58 +0000 (05:48 +0000)]
4.3.4 last minute changes.

16 years agoAutoconfigure NROFF. Traditional nroff now works in addition to
Markus Armbruster [Wed, 24 May 2006 19:56:13 +0000 (19:56 +0000)]
Autoconfigure NROFF.  Traditional nroff now works in addition to
groff.

16 years agoDon't use -I with $(NROFF), old versions of groff and traditional
Markus Armbruster [Wed, 24 May 2006 19:55:05 +0000 (19:55 +0000)]
Don't use -I with $(NROFF), old versions of groff and traditional
nroff don't support it.

16 years ago(natstr): Remove unused member nat_spare[].
Markus Armbruster [Wed, 24 May 2006 18:33:28 +0000 (18:33 +0000)]
(natstr): Remove unused member nat_spare[].

16 years ago(verify_fail): New parameter idx. Use it to print array index when
Markus Armbruster [Wed, 24 May 2006 18:32:13 +0000 (18:32 +0000)]
(verify_fail): New parameter idx.  Use it to print array index when
applicable.  Callers changed.

16 years agoSuSE 9.3 reportedly needs -lncurses for setupterm().
Markus Armbruster [Wed, 24 May 2006 18:26:34 +0000 (18:26 +0000)]
SuSE 9.3 reportedly needs -lncurses for setupterm().

16 years agoUpdate for 4.3.4.
Markus Armbruster [Tue, 23 May 2006 18:14:17 +0000 (18:14 +0000)]
Update for 4.3.4.

16 years agoDocument need for curses.
Markus Armbruster [Tue, 23 May 2006 18:04:11 +0000 (18:04 +0000)]
Document need for curses.

16 years ago(prmptrd, uprmptrd): Oops on null prompt. getstarg() is sometimes
Markus Armbruster [Tue, 23 May 2006 06:04:55 +0000 (06:04 +0000)]
(prmptrd, uprmptrd): Oops on null prompt.  getstarg() is sometimes
called with a null prompt when it is believed not to use it, and that
belief is sometimes wrong.  Other users could have similar bugs.  Some
systems (GNU, Windows) deal gracefully with printing null strings,
others crash.

16 years ago(nat_ca, cou_ca, ef_init_srv, xdvisible): Plug major information leak:
Markus Armbruster [Mon, 22 May 2006 20:59:11 +0000 (20:59 +0000)]
(nat_ca, cou_ca, ef_init_srv, xdvisible): Plug major information leak:
nat_ca[] was designed for visibility to the owner only, while cou_ca[]
was designed for the public.  xdvisible() implemented that for xdump.
But selectors don't care for that!  Since nat_ca[] applies to
EF_NATION, it must be for public visibility.  Broken in 4.2.21.  Fix
by exchanging contents of nat_ca[] and and cou_ca[].  This breaks
clients relying on xdump.

16 years ago(command): Remove unused local variable i.
Ron Koenderink [Mon, 22 May 2006 20:37:20 +0000 (20:37 +0000)]
(command): Remove unused local variable i.

16 years ago(command): Don't fold conditionals to lower case. This was added
Markus Armbruster [Mon, 22 May 2006 20:04:54 +0000 (20:04 +0000)]
(command): Don't fold conditionals to lower case.  This was added
early in Chainsaw 3, most probably to make them case insensitive.
This is of debatable utility, and inconsistent with the case
sensitivity of commands and arguments.  It also interferes with string
conditionals: fleet#A is folded to fleet#a, which means something
else!

16 years agoMinimize redundancy between (mortal's) xdump nation and xdump country:
Markus Armbruster [Mon, 22 May 2006 19:58:44 +0000 (19:58 +0000)]
Minimize redundancy between (mortal's) xdump nation and xdump country:
(ef_init_srv): Make NSC_DEITY in cou_ca mirror ~NSC_EXTRA in nat_ca,
except for cnum, which may not have either flag in either table.
(nat_ca): Make selectors stat, cname, passwd, xorg, yorg, relations,
contacts and rejects NSC_EXTRA.

16 years ago(edit): Crashed when country argument didn't name a country. Fix &
Markus Armbruster [Mon, 22 May 2006 18:51:24 +0000 (18:51 +0000)]
(edit): Crashed when country argument didn't name a country.  Fix &
simplify.  Reported by Pat Loney.

16 years ago(nuke): Removed unused local variable.
Ron Koenderink [Mon, 22 May 2006 17:23:31 +0000 (17:23 +0000)]
(nuke): Removed unused local variable.

16 years ago(att_get_offense): Remove unused local variables.
Ron Koenderink [Mon, 22 May 2006 17:22:28 +0000 (17:22 +0000)]
(att_get_offense): Remove unused local variables.

16 years agoRev. 1.26 screwed up return value for building, which was visible in
Markus Armbruster [Sun, 21 May 2006 20:24:36 +0000 (20:24 +0000)]
Rev. 1.26 screwed up return value for building, which was visible in
output of budget.  Reported by Stefan Hauser.

16 years ago(nstr_resolve_id): Resolve ambigous name into string if string_ok.
Markus Armbruster [Sun, 21 May 2006 20:05:50 +0000 (20:05 +0000)]
(nstr_resolve_id): Resolve ambigous name into string if string_ok.

(nstr_comp_val): Break long line.

16 years ago(NSC_GENITEM, ship_ca, plane_ca, land_ca): Change selectors group,
Markus Armbruster [Sun, 21 May 2006 17:25:40 +0000 (17:25 +0000)]
(NSC_GENITEM, ship_ca, plane_ca, land_ca): Change selectors group,
fleet, wing and army from numbers to user-friendly strings.  This
makes ?fleet#'a' work.  Closes #928405.

16 years agoPurge the register keyword.
Markus Armbruster [Sun, 21 May 2006 13:18:57 +0000 (13:18 +0000)]
Purge the register keyword.

16 years agoLine breaks and other formatting issues. No functional changes.
Markus Armbruster [Sun, 21 May 2006 13:05:24 +0000 (13:05 +0000)]
Line breaks and other formatting issues.  No functional changes.

16 years ago(pln_hitchance): Change tfact from float to double, because it is used
Markus Armbruster [Sun, 21 May 2006 13:03:40 +0000 (13:03 +0000)]
(pln_hitchance): Change tfact from float to double, because it is used
as double.

16 years agoRemove superflous casts and parenthesis.
Markus Armbruster [Sun, 21 May 2006 12:24:30 +0000 (12:24 +0000)]
Remove superflous casts and parenthesis.

16 years ago(get_dtotal): Simplify.
Markus Armbruster [Sun, 21 May 2006 09:33:24 +0000 (09:33 +0000)]
(get_dtotal): Simplify.

(att_reacting_units): Simplify.

(get_osupport, get_dsupport, get_mine_dsupport, att_calcodds): Remove
redundant casts and parenthesis.

(att_fight): Simplify.

(att_calcodds): Supply static keyword forgotten in rev. 1.49.

(sector_strength): Simplify.  Oops on impossible result.

16 years ago(attack_val): Don't truncate or round intermediate values, truncate
Markus Armbruster [Sun, 21 May 2006 09:23:42 +0000 (09:23 +0000)]
(attack_val): Don't truncate or round intermediate values, truncate
final result, like defense_val() does.

(defense_val): Simplify.  Remove check sanity check that is not
appropriate here.

16 years ago(pln_sel): Clarification. No functional change.
Markus Armbruster [Sun, 21 May 2006 09:08:57 +0000 (09:08 +0000)]
(pln_sel): Clarification.  No functional change.

(pln_mobcost): Don't round cost computation intermediate values.

(pln_mobcost): Don't limit cost to current mobility + 32.  No
airworthy plane can possibly use more than 55 mobility in one sortie,
and mobility going that much negative is fine.

16 years ago(sectdamage): Simplify.
Markus Armbruster [Sun, 21 May 2006 08:56:17 +0000 (08:56 +0000)]
(sectdamage): Simplify.

16 years ago(prod): Round the final cost instead of truncating along the way.
Markus Armbruster [Sun, 21 May 2006 08:48:16 +0000 (08:48 +0000)]
(prod): Round the final cost instead of truncating along the way.

(prod, produce): Simplify calculation TECH_POP cost factor slightly.

16 years ago(plane_sona): Compute range multiplier in double rather than int, to
Markus Armbruster [Sun, 21 May 2006 08:17:15 +0000 (08:17 +0000)]
(plane_sona): Compute range multiplier in double rather than int, to
match the formula used for sweep chance in plane_sweep().  Rounding
intermediate values is ugly anyway.

16 years ago(landdamage): Code to guard against zero land_mob_max was broken.
Markus Armbruster [Sun, 21 May 2006 07:59:19 +0000 (07:59 +0000)]
(landdamage): Code to guard against zero land_mob_max was broken.
Remove it, as fixing it isn't worth it.  Remove superflous casts.

16 years ago(explore, ask_move_in_off): Compute weight as double, for consistency
Markus Armbruster [Sun, 21 May 2006 07:42:53 +0000 (07:42 +0000)]
(explore, ask_move_in_off): Compute weight as double, for consistency
with similar computations elsewhere.

16 years ago(deliver): Change mcost from float to double, because it's used as
Markus Armbruster [Sun, 21 May 2006 07:27:11 +0000 (07:27 +0000)]
(deliver): Change mcost from float to double, because it's used as
double but never as float.  This avoids converting the value of
sector_mcost() to float and back.

16 years ago(coas, skyw): Don't convert value of tfact() to float and back.
Markus Armbruster [Sun, 21 May 2006 07:24:49 +0000 (07:24 +0000)]
(coas, skyw): Don't convert value of tfact() to float and back.

16 years ago(shp_mobcost): New.
Markus Armbruster [Sat, 20 May 2006 19:28:29 +0000 (19:28 +0000)]
(shp_mobcost): New.
(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.

16 years ago(oprange): Fix for non-missile planes: round pln_range/2 down, not up.
Markus Armbruster [Sat, 20 May 2006 17:34:32 +0000 (17:34 +0000)]
(oprange): Fix for non-missile planes: round pln_range/2 down, not up.
Planes didn't actually fly to the incorrect range, but mission showed
it.

16 years ago(lnd_getmil, total_mil): Trivial, inline into callers and remove. The
Markus Armbruster [Sat, 20 May 2006 16:39:58 +0000 (16:39 +0000)]
(lnd_getmil, total_mil): Trivial, inline into callers and remove.  The
abstraction from actual land unit mil encoding provided by them was
too leaky to be relied upon anyway.

16 years ago(take_casualties): Remove superflous casts and parenthesis. Cast to
Markus Armbruster [Sat, 20 May 2006 16:24:15 +0000 (16:24 +0000)]
(take_casualties): Remove superflous casts and parenthesis.  Cast to
double rather than float where result usual arithmetic conversions
obviously convert the cast's result to double.  No functional changes;
code is still ugly and incomprehensible.

16 years ago(att_estimate_defense, att_get_offense): Rename. Remove dead code and
Markus Armbruster [Sat, 20 May 2006 15:17:30 +0000 (15:17 +0000)]
(att_estimate_defense, att_get_offense): Rename.  Remove dead code and
unused last parameter.  Callers changed.

16 years ago(sail): Don't interpret negative x-coordinates as unsail argument.
Markus Armbruster [Sat, 20 May 2006 14:20:24 +0000 (14:20 +0000)]
(sail): Don't interpret negative x-coordinates as unsail argument.

16 years ago(mapindex, mapbuf): Change element type to unsigned short, because 16
Markus Armbruster [Sat, 20 May 2006 14:18:29 +0000 (14:18 +0000)]
(mapindex, mapbuf): Change element type to unsigned short, because 16
bits suffice.

(bestownedpath): Use diroff[] and dirch[].  No functional change.
(dirchar, dx, dy): Remove.

16 years ago(num_teles, redir_fp, pipe_fp, exec_fd, sendeof, prompt, command)
Markus Armbruster [Sat, 20 May 2006 13:54:45 +0000 (13:54 +0000)]
(num_teles, redir_fp, pipe_fp, exec_fd, sendeof, prompt, command)
(ac_intercept, all_missiles, ac_planedamage, ac_doflak, ac_landflak)
(ac_shipflak, ac_fireflak, can_fly, do_evade, att_calcodds)
(emp_setbitmap, lnd_hit_mine, conditions, get_wp, daemonize): Internal
linkage.

16 years ago(makeqt): Unused, remove.
Markus Armbruster [Sat, 20 May 2006 13:41:24 +0000 (13:41 +0000)]
(makeqt): Unused, remove.

16 years ago(ioq_init): Initializing num_teles[] here is unmodular. Remove, as
Markus Armbruster [Sat, 20 May 2006 13:40:56 +0000 (13:40 +0000)]
(ioq_init): Initializing num_teles[] here is unmodular.  Remove, as
default initialization is fine.

16 years ago(tfactfire): Unused since src/lib/subs/landgun.c rev. 1.12, remove.
Markus Armbruster [Sat, 20 May 2006 13:02:40 +0000 (13:02 +0000)]
(tfactfire): Unused since src/lib/subs/landgun.c rev. 1.12, remove.

16 years agoDEFENSE_INFRA was implemented in an odd way: sct_defense was used
Markus Armbruster [Sat, 20 May 2006 11:53:20 +0000 (11:53 +0000)]
DEFENSE_INFRA was implemented in an odd way: sct_defense was used
regardless of the option, but forced to sct_effic when disabled.  This
screws up sct_defense when you disable DEFENSE_INFRA.  Implement it
more like FALLOUT: use sct_defense if enabled, else sct_effic.  The
change should be invisible except in xdump, which shows the real
sct_defense.  Closes #804641.
(SCT_DEFENSE): New.
(dump, sinfra, sector_strength): Use it.
(eff_bomb, build_bridge, build_tower, new, buildeff, sect_damage)
(put_combat, checksect, produce_sect): Don't force sct_defense to
sct_effic when DEFENSE_INFRA is disabled.

16 years ago(improve): Fix unsafe use of opt_DEFENSE_INFRA as array subscript.
Markus Armbruster [Sat, 20 May 2006 11:04:00 +0000 (11:04 +0000)]
(improve): Fix unsafe use of opt_DEFENSE_INFRA as array subscript.

16 years ago(nati): Remove weird code to round max safe population that has no
Markus Armbruster [Sat, 20 May 2006 08:43:24 +0000 (08:43 +0000)]
(nati): Remove weird code to round max safe population that has no
effect unless your floating-point arithmetic is hopelessly broken.
This code appeared in Chainsaw 3.2 or so.  Also remove some redundant
casts.

16 years ago(EF_NATION_REJECTS, nation_rejects): New.
Markus Armbruster [Thu, 18 May 2006 19:42:23 +0000 (19:42 +0000)]
(EF_NATION_REJECTS, nation_rejects): New.
(empfile): Add it.
(nat_ca): Use it.

16 years ago(cou_ca, nat_ca, ef_init_srv): Make selectors relations and rejects
Markus Armbruster [Thu, 18 May 2006 19:20:16 +0000 (19:20 +0000)]
(cou_ca, nat_ca, ef_init_srv): Make selectors relations and rejects
visible to mortals in cou_ca[].

16 years ago(nsc_type): New member NSC_HIDDEN.
Markus Armbruster [Thu, 18 May 2006 19:02:04 +0000 (19:02 +0000)]
(nsc_type): New member NSC_HIDDEN.
(meta_type): Add its entry.
(setnum, nstr_promote, nstr_exec_val): Deal with it.  nstr_exec_val()
implements opt_HIDDEN by mapping unknown values to -1.
(natstr, nat_ca): Use it for member nat_relate.  This also halves its
size.  Fixes very minor leak: before, player could see relations to
all countries, regardless of contact.
(nation_relations): Add entry for -1.

16 years ago(natstr, add, getrejects, putreject): Simplify rejections storage.
Markus Armbruster [Thu, 18 May 2006 18:43:38 +0000 (18:43 +0000)]
(natstr, add, getrejects, putreject): Simplify rejections storage.
The space savings of nibble storage are not worth the hassle,
especially for xdump.

(nat_ca): New selector rejects.

16 years agoSuSE 9.3 reportedly needs -lncurses for setupterm().
Markus Armbruster [Thu, 18 May 2006 18:18:45 +0000 (18:18 +0000)]
SuSE 9.3 reportedly needs -lncurses for setupterm().

16 years agoBump version to 4.3.4.
Markus Armbruster [Thu, 18 May 2006 18:10:27 +0000 (18:10 +0000)]
Bump version to 4.3.4.

16 years agoAnother 4.3.3. change. v4.3.3
Markus Armbruster [Tue, 16 May 2006 21:39:14 +0000 (21:39 +0000)]
Another 4.3.3. change.

Tag 4.0.0 with the date of the r.g.e. announcement.

16 years agoUpdate for current code.
Markus Armbruster [Tue, 16 May 2006 20:46:07 +0000 (20:46 +0000)]
Update for current code.

16 years ago(powe): Simplify.
Markus Armbruster [Tue, 16 May 2006 20:06:24 +0000 (20:06 +0000)]
(powe): Simplify.
(gen_power): Remove redundant parenthesis.

16 years agoFix rev. 1.31.
Markus Armbruster [Tue, 16 May 2006 19:54:33 +0000 (19:54 +0000)]
Fix rev. 1.31.

16 years ago(powe): Rewrite computation of targets[] for power c using
Markus Armbruster [Tue, 16 May 2006 18:59:19 +0000 (18:59 +0000)]
(powe): Rewrite computation of targets[] for power c using
snxtitem()/nxtitem(), for simplicity and more uniform syntax.  Country
names no longer work when specifying more than one country (snxtitem()
restriction).  As usual with nxtitem(), silently ignore unsuitable
items (the old code complained and failed).  Don't skip powerless
countries for power c.  Closes #1025607.
(set_target): Unused, remove.

16 years agoFix markup.
Markus Armbruster [Tue, 16 May 2006 18:46:04 +0000 (18:46 +0000)]
Fix markup.

16 years agoUpdate for 4.3.3.
Markus Armbruster [Sun, 14 May 2006 19:35:40 +0000 (19:35 +0000)]
Update for 4.3.3.

16 years agoProvide example, fix pasto.
Markus Armbruster [Sun, 14 May 2006 19:33:43 +0000 (19:33 +0000)]
Provide example, fix pasto.

16 years ago(shiprepair, planerepair, landrepair): Simplify materials code. No
Markus Armbruster [Sun, 14 May 2006 18:26:25 +0000 (18:26 +0000)]
(shiprepair, planerepair, landrepair): Simplify materials code.  No
functional changes.

16 years ago(shiprepair, landrepair): Always return 1. Change to return void.
Markus Armbruster [Sun, 14 May 2006 18:23:44 +0000 (18:23 +0000)]
(shiprepair, landrepair): Always return 1.  Change to return void.
Simplify callers.

(prod_ship, upd_ship, prod_land, upd_land): Move test for mineff.

(upd_land, feed_land): Move food resupply.

(landrepair): Don't putsect(), update code works directly on cache.

16 years ago(upd_plane, planerepair): New, factored out of prod_plane(). No
Markus Armbruster [Sun, 14 May 2006 18:13:55 +0000 (18:13 +0000)]
(upd_plane, planerepair): New, factored out of prod_plane().  No
functional changes.

16 years ago(prod_plane): Simplify carrier repair code. Oops on bad carrier.
Markus Armbruster [Sun, 14 May 2006 18:09:33 +0000 (18:09 +0000)]
(prod_plane): Simplify carrier repair code.  Oops on bad carrier.

16 years ago(prod_plane): Rename plp to pcp, remove redundant desc. Tally build
Markus Armbruster [Sun, 14 May 2006 17:54:52 +0000 (17:54 +0000)]
(prod_plane): Rename plp to pcp, remove redundant desc.  Tally build
cost without rounding, like ships and land units do.

16 years ago(prod_plane): Simplify test for moving satellite.
Markus Armbruster [Sun, 14 May 2006 17:40:00 +0000 (17:40 +0000)]
(prod_plane): Simplify test for moving satellite.

16 years ago(effrange, torprange, fortrange): New.
Markus Armbruster [Sun, 14 May 2006 14:06:00 +0000 (14:06 +0000)]
(effrange, torprange, fortrange): New.
(multifire, quiet_bigdef, torp, anti_torp, sd, sb)
(lnd_fort_interdiction, lnd_support, perform_mission, oprange)
(shp_fort_interdiction): Use them.  This fixes forts shooting below
FORTEFF in quiet_bigdef(), lnd_fort_interdiction() and
shp_fort_interdiction().  Change variables for rounded ranges to int.

(quiet_bigdef, sd): Don't scale ship firing range by efficiency.

(dd, sb): Simplify.

(sb): Internal linkage.

(perform_mission): Rename range2 to vrange.

16 years agoBreak lines more tastefully.
Markus Armbruster [Sun, 14 May 2006 07:52:20 +0000 (07:52 +0000)]
Break lines more tastefully.

16 years ago(nuke): Players need the uid to work with nukes, show it. Show
Markus Armbruster [Sat, 13 May 2006 15:30:30 +0000 (15:30 +0000)]
(nuke): Players need the uid to work with nukes, show it.  Show
members introduced in nuke.h rev. 1.19 and 1.20: nuk_plane, nuk_effic,
nuk_tech, nuk_stockpile.  Make output similar to the other unit
reports while we're at it.

16 years ago(detonate): Change parameters from carrying plane to nuke and
Markus Armbruster [Sat, 13 May 2006 14:04:03 +0000 (14:04 +0000)]
(detonate): Change parameters from carrying plane to nuke and
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).

16 years ago(nuk_postread): Update nuke location to match that of the plane
Markus Armbruster [Sat, 13 May 2006 13:41:02 +0000 (13:41 +0000)]
(nuk_postread): Update nuke location to match that of the plane
carrying it.  This is required since arming doesn't remove nukes from
the nuke file anymore (arm.c rev. 1.15).

(nuk_prewrite): Properly destroy nuke.  This is required since nuke
file contains individual nukes instead of stockpiles (nuke.h
rev. 1.19).

16 years ago(coun_cmd): Multiple client commands could overrun player->client[].
Markus Armbruster [Sat, 13 May 2006 07:56:12 +0000 (07:56 +0000)]
(coun_cmd): Multiple client commands could overrun player->client[].
Reported by Luigi Auriemma.

16 years agoRemove unused variables.
Markus Armbruster [Sat, 13 May 2006 07:44:52 +0000 (07:44 +0000)]
Remove unused variables.

16 years ago(look_land): Use roundintby() instead of ldround() for int argument.
Markus Armbruster [Sat, 13 May 2006 07:43:59 +0000 (07:43 +0000)]
(look_land): Use roundintby() instead of ldround() for int argument.

16 years agoRemove redundant casts.
Markus Armbruster [Sat, 13 May 2006 07:42:18 +0000 (07:42 +0000)]
Remove redundant casts.

16 years ago(knockdown): Destroy nukes on collapsing bridges. Before, you could
Markus Armbruster [Sat, 13 May 2006 07:24:10 +0000 (07:24 +0000)]
(knockdown): Destroy nukes on collapsing bridges.  Before, you could
rescue them by building a new bridge or arming them on naval planes.

16 years ago(pln_prewrite): Destroy nuke along with the plane carrying it. This
Markus Armbruster [Sat, 13 May 2006 07:22:47 +0000 (07:22 +0000)]
(pln_prewrite): Destroy nuke along with the plane carrying it.  This
is required since arming doesn't remove nukes from the nuke file
anymore (arm.c rev. 1.15).

16 years ago(player_coms): Break lines more tastefully.
Markus Armbruster [Sat, 13 May 2006 07:16:59 +0000 (07:16 +0000)]
(player_coms): Break lines more tastefully.

16 years ago(bp_lbcost): Don't convert the cost from double to float and back.
Markus Armbruster [Sun, 7 May 2006 09:19:21 +0000 (09:19 +0000)]
(bp_lbcost): Don't convert the cost from double to float and back.
Simplify.

16 years ago(hap_req): New.
Markus Armbruster [Sat, 6 May 2006 11:07:35 +0000 (11:07 +0000)]
(hap_req): New.
(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.

16 years ago(fuel): Change extra from float to double, because its value is always
Markus Armbruster [Sat, 6 May 2006 09:02:03 +0000 (09:02 +0000)]
(fuel): Change extra from float to double, because its value is always
computed and used in double.

16 years ago(build_ship, build_land, build_plane): Compute initial efficiency in
Markus Armbruster [Sat, 6 May 2006 08:44:12 +0000 (08:44 +0000)]
(build_ship, build_land, build_plane): Compute initial efficiency in
double rather than float, because all its uses convert it to double.
Remove redundant casts.

16 years ago(comm_bomb): Compute damage percentage in double rather than float,
Markus Armbruster [Sat, 6 May 2006 08:41:01 +0000 (08:41 +0000)]
(comm_bomb): Compute damage percentage in double rather than float,
because all its uses convert it to double.

16 years agoDo not cast to float where default argument promotion obviously
Markus Armbruster [Sat, 6 May 2006 08:34:33 +0000 (08:34 +0000)]
Do not cast to float where default argument promotion obviously
converts the cast's result to double.  Such casts are ugly and may
lose precision.

16 years agoDo not cast to float where usual arithmetic conversions obviously
Markus Armbruster [Sat, 6 May 2006 08:26:31 +0000 (08:26 +0000)]
Do not cast to float where usual arithmetic conversions obviously
convert the cast's result to double.  Such casts are ugly and may lose
precision.

16 years ago(nukstr): Make it a struct genitem: add members nuk_effic, nuk_mobil,
Markus Armbruster [Sat, 6 May 2006 07:37:00 +0000 (07:37 +0000)]
(nukstr): Make it a struct genitem: add members nuk_effic, nuk_mobil,
nuk_tech, nuk_stockpile, nuk_opx, nuk_opy, nuk_mission, nuk_radius.
These have no effect, yet.
(build_nuke): Initialize them.
(nuke_ca): Add genitem selectors: effic, mobil, tech, group, opx, opy,
mission, radius.
(tran_nuke): Zap mission, just in case somebody invents missions for
nukes.
(trade_desc): Show tech and efficiency, for consistency with other
units.

16 years agoChange nuke storage and commands to match other units:
Markus Armbruster [Sat, 6 May 2006 07:20:21 +0000 (07:20 +0000)]
Change nuke storage and commands to match other units:
(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.

16 years agoDon't wrap global variables in a struct for no reason:
Markus Armbruster [Sat, 6 May 2006 06:16:53 +0000 (06:16 +0000)]
Don't wrap global variables in a struct for no reason:
(LwpMaxfd, LwpNfds, LwpReadfds, LwpWritefds, LwpFdwait, LwpDelayq)
(LwpSelProc): New, matching members of LwpSelect, internal linkage.
(lwpSelect, LwpSelect): Remove.

16 years ago(lwpReschedule): Use CANT_HAPPEN() and abort() instead of lwpStatus()
Markus Armbruster [Mon, 1 May 2006 17:10:50 +0000 (17:10 +0000)]
(lwpReschedule): Use CANT_HAPPEN() and abort() instead of lwpStatus()
and exit() for fatal internal errors.

16 years ago(lwpSelect): Use logerror() instead of lwpStatus() to report fatal
Markus Armbruster [Mon, 1 May 2006 17:10:11 +0000 (17:10 +0000)]
(lwpSelect): Use logerror() instead of lwpStatus() to report fatal
error.

16 years agoRemove redundant casts of argument to (prototyped) double parameter.
Markus Armbruster [Mon, 1 May 2006 12:34:16 +0000 (12:34 +0000)]
Remove redundant casts of argument to (prototyped) double parameter.

16 years ago(starve): Prompted twice for sectors when first argument was empty,
Markus Armbruster [Mon, 1 May 2006 06:52:48 +0000 (06:52 +0000)]
(starve): Prompted twice for sectors when first argument was empty,
fix.  Simplify.

16 years ago(increase_mob): Call time() just once, the second call can only
Markus Armbruster [Sun, 30 Apr 2006 18:38:52 +0000 (18:38 +0000)]
(increase_mob): Call time() just once, the second call can only
introduce inaccuracy.  Simplify the loop; it still doesn't make much
sense.

16 years ago(find_escorts, perform_mission): Simplify.
Markus Armbruster [Sun, 30 Apr 2006 18:31:13 +0000 (18:31 +0000)]
(find_escorts, perform_mission): Simplify.

16 years ago(fire_dchrg, fire_torp): Simplify.
Markus Armbruster [Sun, 30 Apr 2006 18:28:54 +0000 (18:28 +0000)]
(fire_dchrg, fire_torp): Simplify.

16 years ago(gen_power): Simplify.
Markus Armbruster [Sun, 30 Apr 2006 18:25:50 +0000 (18:25 +0000)]
(gen_power): Simplify.

16 years ago(get_couval, get_outstand): Remove. Unused since automatic loans were
Markus Armbruster [Sun, 30 Apr 2006 18:20:23 +0000 (18:20 +0000)]
(get_couval, get_outstand): Remove.  Unused since automatic loans were
removed (buy.c rev. 1.18, trad.c rev. 1.15), should have been removed
then.

16 years agoReorder function definitions.
Markus Armbruster [Sun, 30 Apr 2006 16:35:43 +0000 (16:35 +0000)]
Reorder function definitions.