]> git.pond.sub.org Git - empserver/log
empserver
17 years ago(empth_init_signals): Don't catch SIGINT and SIGTERM.
Markus Armbruster [Wed, 7 Jun 2006 21:01:16 +0000 (21:01 +0000)]
(empth_init_signals): Don't catch SIGINT and SIGTERM.
(empth_wait_for_shutdown): New.
(main): Use it to wait for shutdown signal, then shut down.  Closes
#770492.
(empth_exit): Remove the weird special case for main thread.

Implement empth_wait_for_shutdown() for EMPTH_LWP:
[EMPTH_LWP] (lwpInitSigWait, lwpSigWait, lwpSigWakeup): New.
Declaration of lwpSigWait was accidentally committed in the previous
revision of lwp.h.
[EMPTH_LWP] (lwpInitSystem): New parameter waitset, pass it on to
lwpInitSigWait().
[EMPTH_LWP] (lwpReschedule): Call lwpSigWakeup().
[EMPTH_LWP] (empth_init): Declare signals needed by
empth_wait_for_shutdown().
(empth_wait_for_shutdown): Implement on top of lwpSigWait().

Implement empth_wait_for_shutdown() for EMPTH_POSIX:
[EMPTH_POSIX] (empth_init): Block signals, so that
empth_wait_for_shutdown() can use sigwait() safely.
(empth_wait_for_shutdown): Implement on top of sigwait().

Implement empth_wait_for_shutdown() for EMPTH_W32:
(empth_wait_for_shutdown): Implement on top of loc_BlockMainThread().

17 years ago(lwpDestroy): Internal linkage.
Markus Armbruster [Wed, 7 Jun 2006 06:01:29 +0000 (06:01 +0000)]
(lwpDestroy): Internal linkage.
(lwpSelect, lwpStatus): Declare in lwpint.h instead of lwp.h.

17 years ago(lwpEntryPoint): Don't set *LwpContextPtr, that's just been done by
Markus Armbruster [Tue, 6 Jun 2006 21:01:28 +0000 (21:01 +0000)]
(lwpEntryPoint): Don't set *LwpContextPtr, that's just been done by
lwpReschedule().

17 years ago(lwpReschedule): Remove code permitting SIGALRM to be catched safely,
Markus Armbruster [Tue, 6 Jun 2006 20:57:03 +0000 (20:57 +0000)]
(lwpReschedule): Remove code permitting SIGALRM to be catched safely,
because there's no handler for it.
(LCOUNT, oldmask): Remove.
(lwpEntryPoint): Don't initialize oldmask.  Should have been done in
lwpInitSystem() anyway.

17 years agoReorder table entries for clarity. Document.
Markus Armbruster [Tue, 6 Jun 2006 19:27:11 +0000 (19:27 +0000)]
Reorder table entries for clarity.  Document.

17 years ago(P_MAX): New.
Markus Armbruster [Tue, 6 Jun 2006 17:57:30 +0000 (17:57 +0000)]
(P_MAX): New.
(pchr): Use it rather than P_URAN.
(P_SHELL, P_GUN, P_PETROL, P_IRON, P_DUST, P_BAR, P_FOOD, P_OIL)
(P_LCM, P_HCM, P_TLEV, P_RLEV, P_ELEV, P_HLEV, P_URAN): Unused,
remove.

17 years ago(grin): Grind up whatever banks produce instead of P_BAR. This is in
Markus Armbruster [Tue, 6 Jun 2006 17:53:59 +0000 (17:53 +0000)]
(grin): Grind up whatever banks produce instead of P_BAR.  This is in
preparation of getting rid of P_BAR & friends.

(grin): Avail use was wrong when amount was reduced due to the space
limit.

17 years ago(P_SHELL, P_GUN, P_PETROL, P_IRON, P_DUST, P_BAR, P_FOOD, P_OIL)
Markus Armbruster [Mon, 5 Jun 2006 17:44:25 +0000 (17:44 +0000)]
(P_SHELL, P_GUN, P_PETROL, P_IRON, P_DUST, P_BAR, P_FOOD, P_OIL)
(P_LCM, P_HCM, P_TLEV, P_RLEV, P_ELEV, P_HLEV, P_URAN): Use -1 instead
of 0 for `no product', shift down product indexes and update
product.config and sector.config accordingly.
(budg, prod, show_sect_capab, produce, produce_sect): Adapt test for
no product.
(ef_elt_byname): Remove the hack to hide pchr[0].
(prod_eff): Oops on no product.

17 years ago(prprod): New, factored out of prod().
Markus Armbruster [Mon, 5 Jun 2006 15:29:28 +0000 (15:29 +0000)]
(prprod): New, factored out of prod().

(prod): Separate enlistment code from production code.  Simplifies
control flow, and thus gets rid of several compiler warnings.

17 years agoMove signal stuff into src/lib/empthread/, no functional change:
Markus Armbruster [Mon, 5 Jun 2006 08:51:02 +0000 (08:51 +0000)]
Move signal stuff into src/lib/empthread/, no functional change:
(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.

17 years agoMissed a use of MOB_ROAD.
Markus Armbruster [Mon, 5 Jun 2006 07:05:43 +0000 (07:05 +0000)]
Missed a use of MOB_ROAD.

17 years ago4.0.2 made land unit mobility costs differ significantly from normal
Markus Armbruster [Sun, 4 Jun 2006 17:41:12 +0000 (17:41 +0000)]
4.0.2 made land unit mobility costs differ significantly from normal
move costs, but failed to make A* use these costs.  This broke land
unit path finding.  Fix:
(MOB_ROAD, MOB_MOVE, MOB_MARCH): Split MOB_ROAD into MOB_MOVE and
MOB_MARCH.  Users changed.
(lnd_mobcost, sector_mcost): Move minimum mobcost logic to
sector_mcost(), where it is visible to A*.  Also fixes unit reaction
path cost.

(lnd_path): Fix confusing message: don't claim there's no path when
all we really know is that there's no railway.

17 years agoPath finding for trains never worked; it ignored the need for rail:
Markus Armbruster [Sun, 4 Jun 2006 17:27:17 +0000 (17:27 +0000)]
Path finding for trains never worked; it ignored the need for rail:
(sector_mcost, bp_neighbors): Fix for MOB_RAIL and sct_rail == 0.
Closes #781528.

17 years ago(BestDistPath): All callers pass MOB_ROAD to parameter mob_type,
Markus Armbruster [Sun, 4 Jun 2006 16:49:24 +0000 (16:49 +0000)]
(BestDistPath): All callers pass MOB_ROAD to parameter mob_type,
remove it.  Callers changed.

17 years ago(P_WALKING): Unused, remove.
Markus Armbruster [Sun, 4 Jun 2006 16:42:36 +0000 (16:42 +0000)]
(P_WALKING): Unused, remove.
(getpath): Remove P_WALKING case.

17 years agoExplain why not to edit configs in-place.
Markus Armbruster [Sun, 4 Jun 2006 12:27:10 +0000 (12:27 +0000)]
Explain why not to edit configs in-place.

17 years ago(ichr, pchr, dchr, intrchr): Move initializer to new builtin config
Markus Armbruster [Sun, 4 Jun 2006 09:34:39 +0000 (09:34 +0000)]
(ichr, pchr, dchr, intrchr): Move initializer to new builtin config
files item.config, product.config, sect.config, infra.config.
(empfile): Declare the new config files.  Reorder table entries so
that read_builtin_tables() reads the config files in the right order.

(bigcity_dchr, opt_BIG_CITY, init_dchr): Remove.  Deities can edit
sect.config instead.

17 years agoFix the previous revision.
Markus Armbruster [Sun, 4 Jun 2006 09:01:51 +0000 (09:01 +0000)]
Fix the previous revision.

17 years agoDon't check values for immutable fields match when initializing an
Markus Armbruster [Sun, 4 Jun 2006 08:37:37 +0000 (08:37 +0000)]
Don't check values for immutable fields match when initializing an
empty table:
(initialized): New.
(xundump): Set it.
(fldval_must_match): Ignore NSC_CONST when it's clear.

17 years agoFix rev. 1.11.
Markus Armbruster [Sun, 4 Jun 2006 08:33:03 +0000 (08:33 +0000)]
Fix rev. 1.11.

17 years agoFix the revision before previous.
Markus Armbruster [Sun, 4 Jun 2006 08:26:12 +0000 (08:26 +0000)]
Fix the revision before previous.

17 years agoComments, whitespace.
Markus Armbruster [Fri, 2 Jun 2006 05:49:29 +0000 (05:49 +0000)]
Comments, whitespace.

17 years agoFix the previous revision.
Markus Armbruster [Fri, 2 Jun 2006 05:43:31 +0000 (05:43 +0000)]
Fix the previous revision.

17 years ago(pchrstr, pchr_ca, pchr, sctstr, dchr_ca, dchr): Replace pchrstr
Markus Armbruster [Fri, 2 Jun 2006 05:35:54 +0000 (05:35 +0000)]
(pchrstr, pchr_ca, pchr, sctstr, dchr_ca, dchr): Replace pchrstr
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].

17 years agoAllow symbolic references not just to symbol tables:
Markus Armbruster [Thu, 1 Jun 2006 19:15:30 +0000 (19:15 +0000)]
Allow symbolic references not just to symbol tables:
(xunsymbol1): Use ef_elt_byname().
(setsym): Accept any table reference, not just to symbol table.
(symval): New.
(setsym, add2symset): Use it.
(mtsymset): Last remaining user of getsymtab(); inline and simplify.
(getsymtab): Remove.

(xunsymbol1, xunsymbol): Rename.

17 years ago(xunsymbol1): Fix diagnostics.
Markus Armbruster [Thu, 1 Jun 2006 19:06:56 +0000 (19:06 +0000)]
(xunsymbol1): Fix diagnostics.

17 years agoFix the previous revision.
Markus Armbruster [Thu, 1 Jun 2006 18:57:42 +0000 (18:57 +0000)]
Fix the previous revision.

17 years ago(buil): Use ef_elt_byname() instead of typematch().
Markus Armbruster [Thu, 1 Jun 2006 18:57:03 +0000 (18:57 +0000)]
(buil): Use ef_elt_byname() instead of typematch().
(typematch): Unused, remove.

17 years agoSymbolic names for table entries in conditionals, closes #928376:
Markus Armbruster [Thu, 1 Jun 2006 18:48:42 +0000 (18:48 +0000)]
Symbolic names for table entries in conditionals, closes #928376:
(ef_elt_byname): New.
(nstr_match_val): Use it to generalize to arbitrary table with
uniquely named elements.  Use ca_type to find table, remove parameter
type.  Callers changed.
(nstr_mkselval): Adapt sanity check accordingly.
(NSC_TYPEID): No longer needed, remove, users changed to use
appropriate integer type instead.  This fixes signedness of sector
selectors des and newdes.
(meta_type): Remove entry for NSC_TYPEID.
(nstr_coerce_val): Can't detect typeid - integer mismatch anymore.
Was nice to have; perhaps revive it later.

17 years ago(getid): Restrict identifier syntax: outlaw conditional operators <>=#
Markus Armbruster [Thu, 1 Jun 2006 18:09:40 +0000 (18:09 +0000)]
(getid): Restrict identifier syntax: outlaw conditional operators <>=#
and meta-character ".

17 years ago(xufld, setstr): Improve diagnostics.
Markus Armbruster [Thu, 1 Jun 2006 18:06:03 +0000 (18:06 +0000)]
(xufld, setstr): Improve diagnostics.

17 years ago(prexpense, budg): Printing brackets around expenses that won't
Markus Armbruster [Thu, 1 Jun 2006 17:42:59 +0000 (17:42 +0000)]
(prexpense, budg): Printing brackets around expenses that won't
actually be paid in full didn't take the update sequence into account,
and wasn't implemented for sector building, military payroll and
capital maintenance.  Remove the feature, as fixing is hardly worth
the trouble.  This renders prexpense() trivial; inline and remove.

17 years ago(update_main): Change update sequence to repair ships, planes and land
Markus Armbruster [Thu, 1 Jun 2006 16:54:00 +0000 (16:54 +0000)]
(update_main): Change update sequence to repair ships, planes and land
units after sectors produce.  This makes repairs use new avail instead
of old.

17 years ago(land, nuke, plan, shi): Change stop prefix to `!'. Explain it in the
Markus Armbruster [Thu, 1 Jun 2006 16:29:54 +0000 (16:29 +0000)]
(land, nuke, plan, shi): Change stop prefix to `!'.  Explain it in the
footer when actually present.

17 years ago(lnd_support): Let land units on missions support, just like ships.
Markus Armbruster [Wed, 31 May 2006 19:58:16 +0000 (19:58 +0000)]
(lnd_support): Let land units on missions support, just like ships.

17 years ago(att_reacting_units): Don't let units loaded on a train react.
Markus Armbruster [Wed, 31 May 2006 19:56:02 +0000 (19:56 +0000)]
(att_reacting_units): Don't let units loaded on a train react.

17 years agoUpdate known contributors comment.
Markus Armbruster [Mon, 29 May 2006 21:23:33 +0000 (21:23 +0000)]
Update known contributors comment.

17 years agoFix the previous revision.
Markus Armbruster [Mon, 29 May 2006 21:20:09 +0000 (21:20 +0000)]
Fix the previous revision.

17 years agoLet players stop/start units:
Markus Armbruster [Mon, 29 May 2006 21:11:14 +0000 (21:11 +0000)]
Let players stop/start units:
(genitem, lndstr, nukstr, plnstr, shpstr): New members off, lnd_off,
nuk_off, pln_off, shp_off.
(NSC_GENITEM): New selector off.
(land, nuke, plan, shi): Display efficiency prefixed by `=' when off.
(start, stop, player_coms): Rewrite, new syntax.  Print only objects
that actually change.
(start_hdr, stop_hdr, start_stop_hdr): Consolidate.
(item_u, start_stop, start_stop_sector, proff, start_stop_unit)
(start_stop_unit_hdr, unit_type_name): New.
(upd_land, upd_plane, planerepair, upd_ship): Obey and clear stoppage.

17 years agoRemove budget priorities:
Markus Armbruster [Mon, 29 May 2006 20:43:30 +0000 (20:43 +0000)]
Remove budget priorities:
(budg, player_coms): Remove command arguments.
(PRI_SMAINT, PRI_PMAINT, PRI_LMAINT, PRI_SBUILD, PRI_PBUILD)
(PRI_LBUILD, PRI_MAX): Remove.
(natstr): Remove member nat_priorities.
(add, main): Remove its initialization.
(budg, cal_call, prexpense, prod, update_main, upd_land, upd_plane)
(upd_buildeff, produce_sect, upd_ship): Simplify.
(produce_sect): Last parameter now superflous, remove & simplify.
(change_prio, do_prod): Unused, remove.

(budg): Move land units output down, to match update sequence.

17 years agoUpdate for current code, and edited for clarity.
Markus Armbruster [Mon, 29 May 2006 20:06:34 +0000 (20:06 +0000)]
Update for current code, and edited for clarity.

17 years agoChange set with nuke.h rev. 1.21 was incomplete (harmless because the
Markus Armbruster [Mon, 29 May 2006 19:29:29 +0000 (19:29 +0000)]
Change set with nuke.h rev. 1.21 was incomplete (harmless because the
missing bits were consistent):
(build_nuke): Assign 0 instead of space.
(nuke): Update printing of group.

17 years ago(plan): Condense columns LSB and nuke into column special. Rename
Markus Armbruster [Mon, 29 May 2006 19:11:24 +0000 (19:11 +0000)]
(plan): Condense columns LSB and nuke into column special.  Rename
column s/l to carry.

17 years ago(land): Show carrier number with a type suffix instead of a prefix,
Markus Armbruster [Mon, 29 May 2006 18:49:14 +0000 (18:49 +0000)]
(land): Show carrier number with a type suffix instead of a prefix,
for consistency with nuke and plane commands.

17 years agoBump version to 4.3.6.
Markus Armbruster [Mon, 29 May 2006 18:39:46 +0000 (18:39 +0000)]
Bump version to 4.3.6.

17 years agoUpdate for 4.3.5. v4.3.5
Markus Armbruster [Sun, 28 May 2006 07:54:10 +0000 (07:54 +0000)]
Update for 4.3.5.

17 years ago(landrepair): Simplify.
Markus Armbruster [Sun, 28 May 2006 07:44:32 +0000 (07:44 +0000)]
(landrepair): Simplify.

17 years ago(nstr_resolve_id): Map identifier ~ to empty string. This makes
Markus Armbruster [Sun, 28 May 2006 07:37:24 +0000 (07:37 +0000)]
(nstr_resolve_id): Map identifier ~ to empty string.  This makes
intuitive usage like fleet=~ and name=~ work.

17 years ago(add, plane_bomb, pinflak_planedamage, doship, dounit, doplane, laun)
Markus Armbruster [Sat, 27 May 2006 19:25:12 +0000 (19:25 +0000)]
(add, plane_bomb, pinflak_planedamage, doship, dounit, doplane, laun)
(launch_sat, scra, scut, scuttle_ship, scuttle_land, knockdown)
(ac_planedamage, detonate, attack_val, defense_val, air_damage)
(msl_intercept, msl_launch_mindam, pln_prewrite, shp_prewrite):
Simplify unit destruction: just zero efficiency, leave makelost()
etc. to the prewrite callback.

17 years agoChange encoding of `not in any group' from space to 0, because that's
Markus Armbruster [Sat, 27 May 2006 13:44:18 +0000 (13:44 +0000)]
Change encoding of `not in any group' from space to 0, because that's
friendlier in conditionals:
(army, build_ship, build_land, build_plane, doship, doplane, dounit)
(flee, check_trade, wing, snxtitem_group, takeover_ship)
(takeover_land): Assign 0 instead of space.
(carg, lcarg, pr_ship, pr_plane, pr_land, ldump, land, pdump, plan)
(retr, lretr, sdump, shi, lnd_list, shp_list, ask_olist, att_prompt)
(ask_move_in): Update printing of group.

(takeover_plane): Failed to clear wing.

17 years agoClean up rev. 1.44, 1.20 and 1.4.
Markus Armbruster [Fri, 26 May 2006 19:32:29 +0000 (19:32 +0000)]
Clean up rev. 1.44, 1.20 and 1.4.

17 years agoCoding style, comments, spelling...
Markus Armbruster [Fri, 26 May 2006 18:46:50 +0000 (18:46 +0000)]
Coding style, comments, spelling...

17 years ago(food_needed): New.
Markus Armbruster [Fri, 26 May 2006 18:22:42 +0000 (18:22 +0000)]
(food_needed): New.
(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.

17 years ago(ask_olist): Fix rev. 1.45. The bug makes it impossible to assault or
Markus Armbruster [Fri, 26 May 2006 17:53:53 +0000 (17:53 +0000)]
(ask_olist): Fix rev. 1.45.  The bug makes it impossible to assault or
board with land units.

17 years agoBump version to 4.3.5.
Markus Armbruster [Fri, 26 May 2006 05:09:00 +0000 (05:09 +0000)]
Bump version to 4.3.5.

17 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.

17 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.

17 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.

17 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.

17 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[].

17 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.

17 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().

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

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

17 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.

17 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.

17 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.

17 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!

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

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

17 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.

17 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.

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

17 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.

17 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.

17 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.

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

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

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

17 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.

17 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.