Commit graph

2164 commits

Author SHA1 Message Date
08937006d7 (prprod): New, factored out of prod().
(prod): Separate enlistment code from production code.  Simplifies
control flow, and thus gets rid of several compiler warnings.
2006-06-05 15:29:28 +00:00
32e4fbd284 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.
2006-06-05 08:51:02 +00:00
1479673302 Missed a use of MOB_ROAD. 2006-06-05 07:05:43 +00:00
5ad86bc7ce 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.
2006-06-04 17:41:12 +00:00
6ab05ae8a1 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.
2006-06-04 17:27:17 +00:00
20c02295a6 (BestDistPath): All callers pass MOB_ROAD to parameter mob_type,
remove it.  Callers changed.
2006-06-04 16:49:24 +00:00
0ea38208d1 (P_WALKING): Unused, remove.
(getpath): Remove P_WALKING case.
2006-06-04 16:42:36 +00:00
44318648bf Explain why not to edit configs in-place. 2006-06-04 12:27:10 +00:00
3aea20e1de (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.
2006-06-04 09:34:39 +00:00
a835a4b4d3 Fix the previous revision. 2006-06-04 09:01:51 +00:00
8fa0dcbe17 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.
2006-06-04 08:37:37 +00:00
b7922c9bd8 Fix rev. 1.11. 2006-06-04 08:33:03 +00:00
33e9b773ad Fix the revision before previous. 2006-06-04 08:26:12 +00:00
0b1f561e97 Comments, whitespace. 2006-06-02 05:49:29 +00:00
f70445af2b Fix the previous revision. 2006-06-02 05:43:31 +00:00
da88d91899 (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].
2006-06-02 05:35:54 +00:00
568b9d6639 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.
2006-06-01 19:15:30 +00:00
a1546476bf (xunsymbol1): Fix diagnostics. 2006-06-01 19:06:56 +00:00
401e072824 Fix the previous revision. 2006-06-01 18:57:42 +00:00
6fadcf6e8e (buil): Use ef_elt_byname() instead of typematch().
(typematch): Unused, remove.
2006-06-01 18:57:03 +00:00
c432e3107d 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.
2006-06-01 18:48:42 +00:00
15635c25ae (getid): Restrict identifier syntax: outlaw conditional operators <>=#
and meta-character ".
2006-06-01 18:09:40 +00:00
2faa68c6e3 (xufld, setstr): Improve diagnostics. 2006-06-01 18:06:03 +00:00
565b6630a2 (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.
2006-06-01 17:42:59 +00:00
967299a375 (update_main): Change update sequence to repair ships, planes and land
units after sectors produce.  This makes repairs use new avail instead
of old.
2006-06-01 16:54:00 +00:00
016249c9e5 (land, nuke, plan, shi): Change stop prefix to `!'. Explain it in the
footer when actually present.
2006-06-01 16:29:54 +00:00
b8825e962c (lnd_support): Let land units on missions support, just like ships. 2006-05-31 19:58:16 +00:00
01ed071af4 (att_reacting_units): Don't let units loaded on a train react. 2006-05-31 19:56:02 +00:00
039907d306 Update known contributors comment. 2006-05-29 21:23:33 +00:00
85c8d7bd82 Fix the previous revision. 2006-05-29 21:20:09 +00:00
eb1512d75f 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.
2006-05-29 21:11:14 +00:00
520446ef39 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.
2006-05-29 20:43:30 +00:00
26110320c0 Update for current code, and edited for clarity. 2006-05-29 20:06:34 +00:00
2b57a13d94 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.
2006-05-29 19:29:29 +00:00
d5f8c32342 (plan): Condense columns LSB and nuke into column special. Rename
column s/l to carry.
2006-05-29 19:11:24 +00:00
9a6016aecc (land): Show carrier number with a type suffix instead of a prefix,
for consistency with nuke and plane commands.
2006-05-29 18:49:14 +00:00
3f02f51469 Bump version to 4.3.6. 2006-05-29 18:39:46 +00:00
bd0bf9fdd3 Update for 4.3.5. 2006-05-28 07:54:10 +00:00
9df65336a9 (landrepair): Simplify. 2006-05-28 07:44:32 +00:00
791d32a58a (nstr_resolve_id): Map identifier ~ to empty string. This makes
intuitive usage like fleet=~ and name=~ work.
2006-05-28 07:37:24 +00:00
0c1bd8e98b (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.
2006-05-27 19:25:12 +00:00
1b94ddedc3 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.
2006-05-27 13:44:18 +00:00
a46de3d997 Clean up rev. 1.44, 1.20 and 1.4. 2006-05-26 19:32:29 +00:00
f3e85c2f70 Coding style, comments, spelling... 2006-05-26 18:46:50 +00:00
109dad1bee (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.
2006-05-26 18:22:42 +00:00
0ac31b3ece (ask_olist): Fix rev. 1.45. The bug makes it impossible to assault or
board with land units.
2006-05-26 17:53:53 +00:00
d723532add Bump version to 4.3.5. 2006-05-26 05:09:00 +00:00
56181c1986 The previous revision of Make.mk didn't work with separate build
trees.  Do it in a way that does.
2006-05-25 08:18:20 +00:00
edbf6b0061 4.3.4 last minute changes. 2006-05-25 05:48:58 +00:00
8a81c5b404 Autoconfigure NROFF. Traditional nroff now works in addition to
groff.
2006-05-24 19:56:13 +00:00