Commit graph

425 commits

Author SHA1 Message Date
b4381d0218 4.2.15 last minute changes. 2004-05-26 17:57:40 +00:00
73ad7c07eb Poorly structured and not entirely accurate. Rewrite. Closes
#934465
2004-05-26 17:54:14 +00:00
d77b67fc39 Didn't quite match the code and was confusing. Rewrite. 2004-05-26 17:53:37 +00:00
cf991ed5ea Fix missing include. 2004-05-17 06:15:31 +00:00
eb9d384111 (nstr_comp): Fix handling of condition type mismatch. This bug could
trigger oopses in nstr_exec().

(cond_type_mismatch): Clearer diagnostic message.
2004-05-16 20:14:59 +00:00
654799a8b0 (rada): Fix embarrassing coding error in previous rev. 2004-05-16 16:40:28 +00:00
f1e87e3542 Update for 4.2.15. 2004-05-16 15:00:22 +00:00
a28c6e4373 (doship, doplane, dounit): Fix warnings introduced by previous rev. 2004-05-16 14:24:57 +00:00
c2debd73fc (shp_set_tech, pln_set_tech, lnd_set_tech): New, factored out of build
and upgrade code.
(build_ship, build_plane, build_land, supgr, pupgr, lupgr): Use them.
Upgrading planes no longer sets plane range to maximum.

(pupgr): Just clear the mission, don't bother to clear op area.

(doship, doplane, dounit): Editing tech now updates stats, like an
upgrade command.  Proper range checking.
(warn_deprecated): New.
(pr_ship, doship): Deprecate key 'D'.
(pr_land, dounit): Deprecate key 'A' and 'D'.
2004-05-16 14:19:38 +00:00
65ff91877f (move): Don't ask user whether he wants to abandon the sector when
running on behalf of the test command.  Closes #935470.
2004-05-16 11:40:14 +00:00
052c4d12ef (explore): Clear start sector's MOVE_IN_PROGRESS after updating end
sector.  Otherwise, clearing MOVE_IN_PROGRESS can abandon the start
sector when it shouldn't, leading to bogus records in the `lost' file.
Closes #931184.
2004-05-16 11:23:43 +00:00
d7e3eb9c97 (dship, dounit, doplane): No longer accept efficiency values that
would destroy the edited unit.  Deities can still delete a units by
setting the owner to zero.  Efficiency values less than 10 used to
delete the unit without informing the owner.  Ship efficiency values
between 10 and 20 did inform the owner, but didn't give him any clue
about the reason.
2004-05-15 15:06:07 +00:00
17494e74d1 (SCT_BLD_WORK, SHP_BLD_WORK, PLN_BLD_WORK, LND_BLD_WORK,
NUK_BLD_WORK): New, to encapsulate the formula in one place.

(SCT_MINEFF): New.  Use it instead of literal 20.

(buil): Use CANT_HAPPEN() for internal error.

(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower): Simplify avail calculation.

(lupgr, supgr, pupgr): Charge 15% of total build avail instead of an
undocumented amount computed from build lcm and hcm.

(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower, lupgr, supgr, pupgr): Fix reporting of required avail
when there's not enough.  Closes #942823.

(lupgr, supgr, pupgr): Code printed cost rounded down, but required
and charged unrounded cost.  Confusing.  Round cost down, like the
build command.  Closes #942811.

(UPGR_COST, UPGR_EFF, lupgr, supgr, pupgr): New UPGR_COST, UPGR_COST replace
literal values.

(show_bridge, show_tower): Don't claim bridge building requires
`workers' (whatever that is), since it doesn't.
2004-05-15 13:23:39 +00:00
3d5e881ae4 (eff_bomb, sect_damage): Damage avail just like efficiency. 2004-05-15 09:41:23 +00:00
6229a7a97a (do_feed): Rev. 1.4 accidentally limited avail after rollover to 999,
even when option ROLLOVER_AVAIL was off.  Previous revision correctly
limits rollover to rollover_avail_max, but missed the limiting after
rollover.  Fix.
2004-05-14 20:21:46 +00:00
0e7211738f (prod): Change variable work from double to int. This matches actual
production code better, and fixes a small inaccuracy introduced in
rev. 1.10.

(prod): Production is limited to 999 units.  Fix for production
efficiency > 1, e.g. agribusiness.

(prod): Raw material consumption was incorrectly limited to 999.

(prod): Production backlog was handled incorrectly; it claimed `will
make' lots, `max' less, which is backwards.
2004-05-14 19:53:17 +00:00
fb5a4b8532 (prod): Match materials_cost() more closely. No functional changes. 2004-05-14 19:40:49 +00:00
79e94bf9d1 (produce, prod): Remove some code related to depletion that has no
effect and makes no sense.
2004-05-14 17:26:53 +00:00
6d3f24f9d7 (prod): Rename variables to match produce() more closely. No
functional changes.
2004-05-14 17:19:20 +00:00
7f4e59fb8d (new_work, do_feed, prod, newe): Factor out calculation of work into
new_work().

(ROLLOVER_AVAIL, opt_ROLLOVER_AVAIL, opt_ROLLOVER_AVAIL, Options,
rollover_avail_max, configkeys, vers, new_work): Replace option
ROLLOVER_AVAIL by configuration parameter rollover_avail_max.
2004-05-10 20:30:38 +00:00
b665d57de1 Should have been committed yesterday, together with sona.c. 2004-05-10 20:20:50 +00:00
1639c26424 (multifire): After charging ship mobility (option NOMOBCOST off), the
code sometimes failed to call putship().  Firing at ships was usually
free.
2004-05-10 19:48:42 +00:00
d7e697b1f9 (M_TORP_SHELLS): New.
(perform_mission, torp, fire_torp, quiet_bigdef, use_ammo): Use it.
Closes #917459.
2004-05-09 20:55:30 +00:00
a6bd408323 (do_desi): Don't complain unless FOR_REAL. Closes #923105. 2004-05-09 20:19:54 +00:00
6611a5c595 (stre): Always report mines to deities. Closes #917911. 2004-05-09 19:57:28 +00:00
07f5489977 (opt_SHIP_DECAY, Options, shiprepair): Remove option SHIP_DECAY. 2004-05-09 19:06:48 +00:00
cca6abf934 (do_desi): Zap efficiency only when sct_type really changes. Closes
#935750.
2004-05-09 17:00:16 +00:00
c6678f3899 (line_of_sight): Normalize coordinates before indexing. Closes
#950514.

(line_of_sight): There's just one straight line between two points on
a plane, but on a torus there are four.  Code assumed plane, and thus
could screw up near the origin.  Pick a shortest line of the four.
Partial fix for #950510.
2004-05-09 15:54:00 +00:00
e4d1c38c96 (nstr_exec, nstr_comp_val, nstr_exec_val): Values of type NSTR aren't
implemented and thus cannot occur.  Document this more clearly.

(nstr_comp_val): More logical order.  No functional changes.
2004-05-09 15:44:54 +00:00
b845997df3 Remove superflous include. 2004-05-09 15:22:17 +00:00
60541ccfaf (flash, wall): Long arguments could smash the stack; fix insufficient
buffers.  Closes #940792.

(wall): Don't strip first word from message.  Closes #940790.
2004-04-25 13:09:41 +00:00
Marc Olzheim
40c88d77d8 Don't try to let patch read from unreadable or nonexisting files. 2004-04-14 23:25:31 +00:00
ca80c373bf (comstr, buy, check_market, display_mark, reset, sell): Change comstr
member com_type from mnemo character to item type.
(whichitem): Unused, remove.

(check_market): Use full item name instead of mnemo in telegrams.

(display_mark): Separate arguments for item type and cheapest only.
Cheapest only of specific item type is not implemented.

(rese): Guard against bad com_type.  Delete some code that had no
effect.
2004-04-10 18:48:30 +00:00
988f9a8be7 (commfil, comminit, make): Unused, remove. 2004-04-10 17:07:43 +00:00
60bbb6b0c0 (buy, mark, display_mark): Move argument evaluation from
display_mark() to callers.  buy() no longer accepts "all".  It used to
display all lots, but didn't let you buy any.  Similar nonsense
happened for "" if buy() prompted for it.

(display_mark): Fix size of cheapest_items[].

(player_coms): Document mark accepting "all".
2004-04-10 08:43:19 +00:00
b0627a97cb (i_packing): New. Use where appropriate.
(NPKG, WPKG, UPKG, BPKG, NUMPKG): Turn macros into enumeration
constants.
(NPKG, WPKG, UPKG, BPKG): Move from sect.h to item.h.
2004-04-09 06:30:21 +00:00
d12359938b (iop, iop_t): Unused, remove. 2004-04-08 19:53:17 +00:00
70a87bb3b4 Remove types that no longer exist. 2004-04-08 19:47:51 +00:00
647ca5cec2 (player_coms): Fix move and test syntax. 2004-04-08 19:30:12 +00:00
a8a6f5649f (item_by_name): New, factored out of whatitem(). Use it to simplify
some uses of whatitem().
2004-04-08 19:26:55 +00:00
e42f7e8210 (build_ship, orde, qorde, nav_loadship, load_it, unload_it): Store
item types instead of mnemo characters in shpstr members shp_tstart[]
and shp_tend[].
(com_num): No longer used, remove.

(orde): Simplify swap code.

(prhold): New, factored out of qorde().
2004-04-08 19:14:09 +00:00
7b42409c9a (I_NONE): New. To be used as item type error value and such. 2004-04-08 19:05:42 +00:00
48175e9beb (getstring, getstarg): Use plain char * instead of s_char *. 2004-04-08 17:56:12 +00:00
8f007f7095 (ac_doflak, ac_shipflak): Simplify, no functional changes. 2004-04-08 16:42:19 +00:00
b985192f6f (prod, upd_buildeff): Truncated work to even before sector building.
Fix.
2004-04-08 16:31:31 +00:00
Ron Koenderink
5a0216893f (prod): The production limit due to work was rounded incorrectly. 2004-04-07 22:06:48 +00:00
83478bd79e (OFFSET): Remove, use standard offsetof().
(SETOFF): Unused, remove.
2004-04-07 17:38:43 +00:00
5d302eaad5 (strtox, strtoy): New. Use it instead of inputxy() to avoid the
double-remainder problem: x-coordinate SHRT_MAX+1 is truncated to 0 by
cast to coord, then converted by xabs().  This is wrong unless WORLD_X
divides SHRT_MAX+1.
(sarg_xy, sarg_getrange, sarg_range): Use them.
(inputxy): No longer used, remove.

(sarg_type): Use NS_UNDEF instead of 0.

(sarg_list): Change confusing loop control.  Properly diagnose
overlong lists; used to silently ignore list tail and return MAX+1,
which made a later snxtitem_list() fail.

(atoip): No longer used, remove.  Parsing was broken anyway.

(sarg_type, sarg_xy, sarg_area, sarg_range, sarg_list, sarg_getrange):
Use plain char * instead of s_char *.
2004-04-07 17:13:47 +00:00
543b0cba4f (NS_UNDEF, NS_LIST, NS_DIST, NS_AREA, NS_ALL, NS_XY, NS_GROUP): Turn
macros into enumeration constants.
(ns_seltype): New.  Use where appropriate.
2004-04-06 21:37:52 +00:00
276c188655 (snxtitem): Assigning NS_UNDEF to NP->type is an application domain
type error not reflected in C.  The former is a selection type, the
latter is a file type.  Harmless, as the variable is overwritten on
all paths to successful return.
2004-04-06 18:47:54 +00:00