Commit graph

84 commits

Author SHA1 Message Date
Ron Koenderink
2f1b7cd2a3 (opt_NO_LCMS, opt_NO_HCMS, opt_NO_OIL, Options,
buil, show_bridge, show_tower, nullify_objects):
Remove NO_LCMS, NO_HCMS, and NO_OIL options, not used.
Functionality can be emulated by modifiying the characteristics files.
2005-11-13 16:39:27 +00:00
Ron Koenderink
0a63d324ca (opt_NEUTRON, buil, denotate, show_nuke_capab, show_nuke_build,
Options): Remove opt_NEUTRON option.  The option can be emulated
by manipulating the flags in a nuke characteristics file.
2005-11-13 12:30:37 +00:00
Ron Koenderink
2e655eaf96 (buil, vers, opt_NONUKES, show_nuke_build, show_nuke_capab):
Remove opt_NONUKES options.  A nuke characteristics file can
be created with no entries to create the emulate the removed option.
2005-11-12 20:09:11 +00:00
e23d8a8fac (shp_maxno): Variable's value is well-known constant N_MAXSHIPS + 1.
Useless, remove.  Users changed to check mchr's sentinel, because
that's clearer than comparing the index to N_MAXSHIPS or sizeof(mchr)
/ sizeof(*mchr).

(mchr): Change sentinel's m_name to NULL.
2005-11-06 21:20:49 +00:00
47192c9079 (pln_maxno): Variable's value is well-known constant N_MAXPLANE + 1.
Useless, remove.  Users changed to check plchr's sentinel, because
that's clearer than comparing the index to N_MAXPLANE or sizeof(plchr)
/ sizeof(*plchr).

(plchr): Change sentinel's pl_name to NULL.
2005-11-06 21:12:24 +00:00
04c247f2da (lnd_maxno): Variable's value is well-known constant N_MAXLAND + 1.
Useless, remove.  Users changed to check lchr's sentinel, because
that's clearer than comparing the index to N_MAXLAND or sizeof(lchr) /
sizeof(*lchr).

(lchr): Change sentinel's l_name to NULL.
2005-11-06 20:59:38 +00:00
a7aea6c468 (show_nuke_build, show_nuke_capab): Simplify. 2005-11-06 20:37:57 +00:00
02ec5df820 (lookup, symbol): Rename. Rename members to match selectors and
better reflect their purpose.  Users changed.
(lookup_ca, symbol_ca): Rename.
2005-10-29 07:46:42 +00:00
747d1333cc (intmatch): Assumes that struct size is a multiple of sizeof(int), out
of laziness.  The assumption is true on any sane machine, due to
alignment constraints.  But the function doesn't provide enough value
to make me fix or document this.  Remove it.
(lookup): Replace it.
2005-10-29 07:15:14 +00:00
Ron Koenderink
fcf5c59513 (castr,empfile,ship_chr,plane_chr,land_chr,nuke_chr):
Add table index to castr to create a reference to the symbol table.
Add "ship chr flags" table to empfile.
Add "plane chr flags" table to empfile.
Add "land chr flags" table to empfile.
Add "nuke chr flags" table to empfile.
Add EF_SHIP_CHR_FLAGS reference to ship_chr.
Add EF_PLANE_CHR_FLAGS reference to plane_chr.
Add EF_LAND_CHR_FLAGS reference to land_chr.
Add EF_NUKE_CHR_FLAGS reference to nuke_chr.

(show_ship_capab,show_plane_capab,show_land_capab,
show_nuke_capab,ship_flags,land_flags,plane_flags,nuke_flags):
Move ship_flags nsc.c from show.c
Rename ship_flags to ship_chr_flags.
Move plane_flags nsc.c from show.c
Rename plane_flags to plane_chr_flags.
Move land_flags nsc.c from show.c
Rename land_flags to land_chr_flags.
Move nuke_flags nsc.c from show.c
Rename nuke_flags to nuke_chr_flags.
This is to accomodate future symbol table for EF_PLANE table.
2005-10-22 16:39:45 +00:00
Ron Koenderink
c0d009758c (show_sect_capab, mission_pln_equip, pln_equip): Change i_type
references to use I_NONE instead of zero.  Zero has been invalid since
item.h rev. 1.12, and was questionable style before.
2005-07-07 21:57:15 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
ff67d93711 (max_population): New, factored out of max_pop().
(max_pop): Use it.  Don't support null argument anymore.
(nati, gen_power): Use max_population() instead of max_pop() with null
argument.
(show_sect_stats): Use max_population() to simplify the code.
(prod, upd_buildeff): Use max_population() to get correct new maximum
population for limiting work when tearing down a big city.
Previously, this was broken in upd_buildeff().  In prod(), it was
broken when the new designation had odd maximum population, which
should not occur.
2005-02-17 21:04:08 +00:00
Ron Koenderink
8280b7b201 (show_sect_build): Remove carriage return. 2004-12-15 02:51:08 +00:00
Ron Koenderink
8d792e1b9f (dchr): Negative d_cost now means that only deity can designate.
(nullify_objects, do_desi): Simpify designate restrictions of options
NO_LCMS, NO_HCMS, NO_OIL.

(show_sect_build): Suppress printing of sectors only deity can
designate.  This was broken in rev. 1.15.
2004-10-29 01:38:06 +00:00
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
Marc Olzheim
d30942632b (I_NONE, I_CIVIL, I_MILIT, I_SHELL, I_GUN, I_PETROL, I_IRON, I_DUST,
I_BAR, I_FOOD, I_OIL, I_LCM, I_HCM, I_UW, I_RAD, I_MAX): Turn macros
into enumeration constants.
(i_type): New.  Use where appropriate.  No functional changes, except
that I_NONE is now catched properly in a few places.
2004-09-16 21:18:01 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
Ron Koenderink
133c1754f9 (show_land_build, show_plane_build): Adjust the position of the $ column to match
'show ship b'.  Adjust the crew column (show_plane_build) and the adjacent columns
to be right-justified.
2004-08-28 13:52:20 +00:00
0ebb14c8be (PRI_SMAINT, PRI_PMAINT, PRI_LMAINT, PRI_SBUILD, PRI_PBUILD,
PRI_LBUILD): Turn macros into enumeration constants.  Value
SCT_MAXDEF+1 was previously unused; use it.
(PRI_MAX): New; replacing the horrible SCT_MAXDEF+8.

(show_sect_build): Simply examine all sector types, don't skip the
first five.  The code ignores them just fine.

(show_sect_build, show_sect_stats, show_sect_capab): Don't try to show
sector types beyond SCT_MAXDEF.  The table has some empty extra slots,
for whatever reasons; no use examining them.
2004-08-19 16:59:36 +00:00
ec752ac390 Silence harmless compiler warning. 2004-08-17 19:00:18 +00:00
09def8f156 (show_sect_capab, V_ITEM): The difference between variable and
item types was removed some time ago.  Simplify.
(VT_ITEM, VT_TYPE, V_MAX): Unused, remove.

(show_sect_capab): Properly use ichr[] member i_mnem to print item
characters.
2004-08-17 16:07:01 +00:00
4d154753b8 (pchrstr, MAXPRCON): Simplify variable-style storage of constituents.
Store only up to MAXPRCON constituents, not MAXCHRNV; code doesn't
fully support more than three anyway.  Remove member p_nv, use item
type I_NONE for unused slots.  Rename members p_vtype, p_vamt to
p_ctype, p_camt to avoid confusion with variable-style storage.
(pchr): Initializers adapted.
(nullify_objects, materials_cost, materials_charge, prod,
show_sect_capab, grind): Adapt, simplify where possible, protect
against bad item types in pchr[].
(MAXCHRNV): Unused, remove.
2004-08-17 15:19:46 +00:00
8a0854b6b8 (mchrstr, lchrstr): Change from variable-style storage of load
capacities to straight arrays.  Users now subscript the array instead
of calling vl_find() or walking the variable data structure.
(mchr, lchr): Initializers adapted.
(vl_find): No longer used.  Remove file.
2004-08-17 14:09:04 +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
262e1bafba Remove some unused junk. 2004-03-01 13:48:45 +00:00
8cd0160176 Declare all configuration variables in optlist.h. Include that
instead of declaring them all over the place.  This uncovered type
errors:
(s_p_etu, adj_update): Defined long, sometimes declared int.  Kills
big endian machines where sizeof(long) != sizeof(int).  Change to
int.

(set_option, delete_option, optstrset, intset, floatset, doubleset,
longset, optionset, optiondel, worldxset): Change linkage to static.
2004-02-17 22:58:04 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
d8983db308 (show, show_item): No new `show' features without matching machine
readable dumps.  Back out `show item' for 4.2.13.
2004-02-07 00:27:45 +00:00
0696bb190d Indentation fix. 2004-02-06 23:26:25 +00:00
2fe312adac (at_minimum, blocksig, emp_bitinit, filelogerror, iceil, ifloor,
mapdsq, mask, signame, strscan, sys_siglist, typed_wire, unblocksig):
Unused, remove.

(add_airport, add_to_fired_queue, air_damage, anti_torp, best_path,
bitinit2, blankrow, bmnxtsct, bp_init, build_mission_list,
build_mission_list_type, buildeff, candchrg, canshoot, cantorp,
cede_sect, cede_ship, checksect, client_cmd, coun_cmd,
deity_build_land, divide, do_conv, do_defdam, do_demo, do_desi,
do_mob_land, do_mob_plane, do_mob_sect, do_mob_ship, do_prod,
docountry, doland, doplane, doship, dosupport, dotsprintf, dounit,
empth_start, enlist, errcheck, filereport, find_airport, find_escorts,
findcondition, fire_dchrg, fire_torp, fltp_to_list, get_minimum,
getin, goodsect, grab_sect, grab_ship, grow_people, growfood, in_addr,
infect_people, init_mchr, init_pchr, init_plchr, is_engineer,
itemname, kill_cmd, landrepair, limit_level, list_cmd, lupgr,
materials_charge, materials_cost, meltitems, mission_pln_arm,
mission_pln_sel, move_map, nat_cap, num_units, outid, pass_cmd,
perform_mission, pinflak_planedamage, play_cmd, pln_equip, prexpense,
print_res, prplanes, prunits, pupgr, quiet_bigdef, quit_cmd, radmap2,
retreat_land1, retreat_ship1, s_commod, sanc_cmd, sarg_getrange,
scuttle_it, scuttle_land, set_target, share_incr, shiprepair,
shp_check_mines, shp_check_nav, shp_check_one_mines, shp_hit_mine,
shp_interdict, shp_mess, sort_lookup_list, starvation, supgr, swap,
take_casualties, trunc_people, upd_buildeff, upd_land, upd_ship,
use_ammo, user_cmd): Change linkage to static.
2003-12-17 23:13:50 +00:00
800027023a (show, show_item): New `show item'. From Ron Koenderink; changes to
info files heavily hacked by me.
2003-12-17 19:50:20 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00