Clean up move_ground()'s parsing of DIR_MAP

Split with parse() and pass first two arguments instead of the raw
tail to the map() callback.  Advantages:

* Consistent with do_unit_move().

* Does the right thing when the tail is just spaces.  Before, the
  spaces got passed to the map() callback, which complained about
  syntax.  Now, they are ignored.  This is what the commit I just
  reverted tried to fix.

* Works better when the tail splits into more than two arguments.
  Except for explore_map(), which ignores the argument(s), the map()
  callbacks use display_region_map(), which split the tail at the
  first space, and complained about any spaces in the second part.
  Now, display_region_map() takes two argument strings instead of a
  single, unsplit argument string, and extra arguments get silently
  ignored, as usual.
This commit is contained in:
Markus Armbruster 2011-04-10 18:09:16 +02:00
parent 40cfb41b4e
commit 28d4847416
Notes: Markus Armbruster 2012-02-11 09:54:40 +01:00
Deprecate usage without space between DIR_MAP and first argument.
7 changed files with 36 additions and 34 deletions

View file

@ -61,8 +61,7 @@ extern void blankfill(char *, struct range *, int);
extern void border(struct range *, char *, char *);
/* src/lib/subs/maps.c */
extern int do_map(int bmap, int unit_type, char *arg1, char *arg2);
extern int display_region_map(int bmap, int unit_type, coord curx,
coord cury, char *arg);
extern int display_region_map(int, int, coord, coord, char *, char *);
extern int bmaps_intersect(natid, natid);
extern int share_bmap(natid, natid, struct nstr_sect *, char, char *);