Commit graph

15 commits

Author SHA1 Message Date
7bbbcc8643 Define common get/put macros for empobj
This turns existing functions get_empobjp() and put_empobj() into
equivalent macros.
2008-02-26 21:07:58 +01:00
59c65239f7 Fix put_empobj() for types other than units
put_empobj() used struct empobj member uid, which is valid only for
units.  Existing users pass only units, fortunately.  Fix by making it
take type and uid parameters.
2008-02-26 21:07:58 +01:00
74e873e96c Make sector types signed
get_empobj_chr() and emp_obj_chr_name() access struct sctstr member
sct_type through struct empobj member type.  This is technically
non-portable, because the two differ in signedness.  It was also
undocumented.  Fix by making sct_type signed.  sct_newtype as well,
for consistency.

map_char() uses unsigned char for a sector type argument.  Change that
to int.  Matches how this is done elsewhere.
2008-02-26 21:07:57 +01:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
654335c621 New Empire table game, to be used for global stuff:
(gamestr, EF_GAME, game_ca): New.
(empfile): Declare the table.
(ef_open_srv, ef_close_srv): Open and close it.
(main): Create it.
(empobj_storage): New member game.

(EF_DYNMAX): New.
(EF_IS_GAME_STATE): Use it.
2007-07-14 14:49:58 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
Ron Koenderink
ebf588b713 (empobj_chr): New, create a new (imcomplete) structure for
empobj characteristics.
(get_empobj_chr):  Update get_empobj_chr() to use new
struct empobj_chr.
2006-08-18 23:32:45 +00:00
Ron Koenderink
34f29824eb (get_empobj_mob_max): Switch ef_type to type to be more consistent
with other functions.
2006-07-26 00:40:33 +00:00
Ron Koenderink
fec9878ca4 (get_empobjp): New. Returns a pointer an empobj.
(emp_obj_chr_name): New. Returns a pointer to the characteristics name
for an empobj.
(unit_map):  Simplify unit_map() by using get_empobjp() and
emp_obj_chr_name().
(map,  cmd_move_map):  Switch to EF_SHIP as unit_map does not default
to EF_SHIP for EF_BAD anymore.
2006-07-26 00:21:58 +00:00
Ron Koenderink
b70653815c (get_empobj_mob_max): New. Return maximum mobility based on ef_type.
(miss): Use new get_empobj_mob_max().
2006-07-24 13:40:12 +00:00
Ron Koenderink
a62989d4a3 (put_empobj): New. Put generic empobj into the appropriate data file.
(get_empobj_chr): New.  Get characteristics for empobj.
(mission, build_mission_list_type): Switch to use new
functions put_empobj() and get_empobj_chr().
2006-07-20 14:12:35 +00:00
Ron Koenderink
6d90861aae (obj_nameof): New.
(nameofitem): Remove, switch callers to to obj_nameof().
(mission, show_mission): Convert functions to use obj_nameof()
instead of nameofitem().
2006-07-10 23:14:26 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
Ron Koenderink
1b0ff6cbac Correct file name in the comments to match the actual file name. 2006-07-08 00:27:20 +00:00
Ron Koenderink
79ee88f7c6 (nxtitemp, trade_getitem, trade_desc, trade_check_item_ok, nxtitem,
oprange, show_mission, nameofitem, build_mission_list_type,
unit_map, xdvisible, trdswitchown, ontradingblock, trad, check_trade,
unit_type_name, start_stop_unit, scut, scra, mission, multifire,
perform_mission, fuel, NSC_GENITEM): Replace struct genitem with
struct empobj.  Remove genitem.h and create a new file empobj.h.
Replace multiple instances of unions of ef_type structures with
one standard union empobj_storage which is a superset of the individual
instances.
2006-07-07 15:15:43 +00:00
Renamed from include/genitem.h (Browse further)