#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.
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.
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".
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().
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 *.
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.
is somewhat stricter.
(is_wday_allowed, is_daytime_allowed, is_daytime_nar,
min_to_next_daytime): New.
(demand_update_time, scheduled_update_time, next_scheduled_time,
update_time, gamehours): Use them to replace kw_parse().
(kw_parse): No longer used, remove.
according to context, to make `lstat * ?type#spy&spy>1' work. Closes
bug#825363, #905809, #905814 and #922968.
(nsc_type, packed_nsc_type, nsc_cat, packed_nsc_cat, nsc_flags): New.
(valstr): New. Old code encoded values in type long, which was
somewhat hard to read and could only support signed integer values.
(nscstr): Redesign. Use valstr. Typed operator.
(castr): Split ca_code into ca_type, ca_flags, ca_off. Tables
changed.
(nstr_comp, nstr_exec): Redesign and rewrite. Callers changed. They
used the old design incorrectly, which let players smash the stack
by supplying more than NCOND conditions.
(encode, nstr_comp_val, decode, nstr_exec_val): Rename, redesign, and
rewrite. Callers changed.
(nstr_coerce_val): New.
(var_ca, sect_ca, ship_ca, land_ca): Checking both var_ca[] and the
object's ca complicates proper recognition of unique abbreviations.
Copy contents of var_ca[] into the ca of objects, remove var_ca[].
(surv): Reject values with category other than NSC_OFF and types that
can't be coerced to NSC_LONG. Old code happily passed values with
category NSC_VAL to code_char(). The previous version interpreted
them correctly, but earlier versions interpreted them as NSC_OFF, then
logged `bad type in decode: 0' and evaluated them into zero.
(code_char): Used to test category NSC_VAR to decide whether to
display tens or hundreds. NSC_VAR no longer exists. Test type
instead. Makes more sense anyway.
command line for reproducible automated tests. This is expected to be
a temporary solution until we get more capable system configuration.
Callers of random(), srandom() changed. From Marc Olzheim.