]> git.pond.sub.org Git - empserver/log
empserver
17 years ago(lnd_mobtype): New.
Markus Armbruster [Tue, 13 Jun 2006 21:07:44 +0000 (21:07 +0000)]
(lnd_mobtype): New.
(lnd_path): Use it.
(lnd_mobcost): Use it, remove last parameter.  Callers changed.  This
fixes mobility use of trains when retreating, both for retreat orders
and for failed morale checks.
(retreat_land1): Fix test for impassable terrain.  Before, trains
could retreat off rail.
(lnd_take_casualty): Test for impassable terrain.  Before, trains
could retreat off rail.

17 years agoMake land unit attack mobility cost consistent with march cost:
Markus Armbruster [Tue, 13 Jun 2006 20:29:47 +0000 (20:29 +0000)]
Make land unit attack mobility cost consistent with march cost:
(att_mobcost): New.
(ask_olist, take_move_in_mob): Use it.  Attacking land units can now
use roads and suffer the newly taken penalty.  No difference in most
cases, because the penalty commonly cancels the road bonus.
(get_mob_support, calc_mobcost, ask_move_in_off): Use it.  No
functional change now; ensures that military's attack mobility cost
will stay consistent with move cost.
(MOB_NONE): Unused, remove.
(sector_mcost): Simplify.

17 years ago(att_fight): Don't charge the defending sector any mobility when it's
Markus Armbruster [Tue, 13 Jun 2006 18:35:49 +0000 (18:35 +0000)]
(att_fight): Don't charge the defending sector any mobility when it's
already negative.  Used to charge proportional to its absolute value,
which makes no sense.

(att_fight): Oops when attacker's mobility is negative rather than
charging negative mobility.

Remove superflous casts and parenthesis.

17 years agoChange maximum population to 100 for plains (was 49), mountains (was
Markus Armbruster [Tue, 13 Jun 2006 17:52:46 +0000 (17:52 +0000)]
Change maximum population to 100 for plains (was 49), mountains (was
99), bridge spans and bridge towers (was 999), and to 1000 for the
other habitable sector types (was 999).

17 years ago(max_population): Deal gracefully with big city 10 * d_maxpop >
Markus Armbruster [Tue, 13 Jun 2006 17:46:04 +0000 (17:46 +0000)]
(max_population): Deal gracefully with big city 10 * d_maxpop >
ITEM_MAX: let value grow linearly from d_maxpop at 0% to the minimum
of 10 * d_maxpop and ITEM_MAX at 100%.

17 years agoReplace incorrect sea mine hit chance by reference to info Hitchance.
Markus Armbruster [Sun, 11 Jun 2006 19:30:19 +0000 (19:30 +0000)]
Replace incorrect sea mine hit chance by reference to info Hitchance.

17 years agoUpdate for changed plane abort chance.
Markus Armbruster [Sun, 11 Jun 2006 19:27:07 +0000 (19:27 +0000)]
Update for changed plane abort chance.

17 years ago(shp_sweep): New parameter takemob. Charge mobility only if it's
Markus Armbruster [Sun, 11 Jun 2006 18:09:09 +0000 (18:09 +0000)]
(shp_sweep): New parameter takemob.  Charge mobility only if it's
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.

17 years ago(ac_planedamage): Planes may abort when damaged below 80% efficiency.
Markus Armbruster [Sun, 11 Jun 2006 16:02:13 +0000 (16:02 +0000)]
(ac_planedamage): Planes may abort when damaged below 80% efficiency.
Reduce abort chance from 100-eff to 80-eff.  This should make it
easier to punch through air defense, flak in particular, and increase
the risk of getting shot down.

17 years ago(ac_shipflak, ac_landflak): Reduce flak proportional to efficiency.
Markus Armbruster [Sun, 11 Jun 2006 05:12:47 +0000 (05:12 +0000)]
(ac_shipflak, ac_landflak): Reduce flak proportional to efficiency.
Rename some auto variables.  Closes #759402.

17 years ago(FLAK_GUN_MAX): New.
Markus Armbruster [Sat, 10 Jun 2006 18:26:57 +0000 (18:26 +0000)]
(FLAK_GUN_MAX): New.
(ac_doflak, ac_shipflak, ac_landflak): Use it.
(ac_shipflak, ac_landflak): Tally flak for all ships / units, then
limit to FLAK_GUN_MAX guns of average tech.  Used to limit to
FLAK_GUN_MAX guns *after* ship / land unit tech factor was applied by
exiting the loop early, then reduce *again* for nation tech of whoever
owns the last ship visited.  Makes no sense.  Exiting the loop early
is no good, because it can skip plane spotting.  This change and the
one below make low-tech ship and land unit flak more powerful;
rebalancing might be needed.

(ac_doflak, ac_landflak, ac_shipflak): Round flak randomly instead of
down.  This simplifies things.  In particular, you no longer have to
calculate how many low-tech ships to bunch together to get any flak.

17 years ago(ac_fireflak): Remove parameter other, all callers pass 0. Callers
Markus Armbruster [Sat, 10 Jun 2006 17:53:24 +0000 (17:53 +0000)]
(ac_fireflak): Remove parameter other, all callers pass 0.  Callers
changed.

17 years ago(calc_all): Match the real update sequence. Until removal of budget
Markus Armbruster [Sat, 10 Jun 2006 16:20:31 +0000 (16:20 +0000)]
(calc_all): Match the real update sequence.  Until removal of budget
priorities (rev. 1.25), calc_all() tried to match the real sequence,
but didn't quire succeed to cope with all variations.  Then it matched
until the update sequence change in src/lib/update/main.c rev. 1.25.
This is required but not sufficient for closing #1310407.

17 years ago(service_main) [_WIN32]: Added the missing empth_wait_for_signal() and
Ron Koenderink [Sat, 10 Jun 2006 04:11:16 +0000 (04:11 +0000)]
(service_main) [_WIN32]: Added the missing empth_wait_for_signal() and
shutdown() for when the server is running at WIN32 service.  This fix
incorporates the changes that where done to the main thread.

17 years ago(empth_wait_for_signal) [_WIN32]: Add thread block for the main thread,
Ron Koenderink [Sat, 10 Jun 2006 03:57:50 +0000 (03:57 +0000)]
(empth_wait_for_signal) [_WIN32]: Add thread block for the main thread,
otherwise the main thread blocks all others.

17 years ago(update_main): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:43:33 +0000 (00:43 +0000)]
(update_main): Remove unused local variables.

17 years ago(journal_entry): Remove unused local variable.
Ron Koenderink [Fri, 9 Jun 2006 00:41:51 +0000 (00:41 +0000)]
(journal_entry): Remove unused local variable.

17 years ago(mtsymset, add2symset): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:26:59 +0000 (00:26 +0000)]
(mtsymset, add2symset): Remove unused local variables.

17 years ago(starv_units): Remove unused local variable.
Ron Koenderink [Fri, 9 Jun 2006 00:25:39 +0000 (00:25 +0000)]
(starv_units): Remove unused local variable.

17 years ago(getpath): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:24:06 +0000 (00:24 +0000)]
(getpath): Remove unused local variables.

17 years ago(feed_land): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:17:44 +0000 (00:17 +0000)]
(feed_land): Remove unused local variables.

17 years ago(budg,calc_all): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:16:48 +0000 (00:16 +0000)]
(budg,calc_all): Remove unused local variables.

17 years ago(cant_listen): Supply missing newline.
Markus Armbruster [Thu, 8 Jun 2006 20:55:17 +0000 (20:55 +0000)]
(cant_listen): Supply missing newline.

17 years ago(lnd_pathcost): New, factored out of lnd_mobcost().
Markus Armbruster [Thu, 8 Jun 2006 20:43:13 +0000 (20:43 +0000)]
(lnd_pathcost): New, factored out of lnd_mobcost().
(att_reacting_units): Use it.  Fixes overcharging of inefficient
units.  Broken when Empire3 changed land unit mobility use not to
depend on efficiency, except for supply units.
(lnd_sweep): Use it.  No functional change.

(speed_factor): New, factored out of lnd_pathcost() and shp_mobcost().

17 years ago(ef_verify): Check pchr[].p_level matches pchr[].p_type.
Markus Armbruster [Thu, 8 Jun 2006 20:22:58 +0000 (20:22 +0000)]
(ef_verify): Check pchr[].p_level matches pchr[].p_type.

17 years ago(teldir, motdfil, downfil, disablefil, telfil, annfil, timestampfil):
Markus Armbruster [Thu, 8 Jun 2006 20:22:11 +0000 (20:22 +0000)]
(teldir, motdfil, downfil, disablefil, telfil, annfil, timestampfil):
Change to arrays.

17 years ago(shutdwn) [_WIN32]: Not supposed to return, so don't.
Markus Armbruster [Thu, 8 Jun 2006 20:20:02 +0000 (20:20 +0000)]
(shutdwn) [_WIN32]: Not supposed to return, so don't.

17 years agoFinally merge the journal patch:
Markus Armbruster [Thu, 8 Jun 2006 20:11:26 +0000 (20:11 +0000)]
Finally merge the journal patch:
(keep_journal): New econfig key.
(player_main): Log player login and logout.
(recvclient): Log player input.
(ef_open_srv, ef_close_srv): Log startup and shutdown.
(update_main): Log update.

Support the common SIGHUP log rotation idiom:
(empth_wait_for_shutdown, empth_wait_for_signal): Rename.
[EMPTH_LWP, EMPTH_POSIX] (empth_init, empth_wait_for_signal): Wait for
SIGHUP as well.
(main) [SIGHUP]: Reopen journal when empth_wait_for_signal() returns
SIGHUP.

17 years ago(LwpContextPtr, lwpInitSystem): Use void ** for pointer to generic
Markus Armbruster [Thu, 8 Jun 2006 05:38:06 +0000 (05:38 +0000)]
(LwpContextPtr, lwpInitSystem): Use void ** for pointer to generic
pointer.  Users changed.

17 years ago(shutdwn): No longer a signal handler, no need to avoid sleeping.
Markus Armbruster [Wed, 7 Jun 2006 21:45:46 +0000 (21:45 +0000)]
(shutdwn): No longer a signal handler, no need to avoid sleeping.
This lets player threads send C_EXIT properly even when the server
shuts down on a signal.

17 years agoFix the previous revision.
Markus Armbruster [Wed, 7 Jun 2006 21:39:01 +0000 (21:39 +0000)]
Fix the previous revision.

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.