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:
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
|
@ -39,7 +39,7 @@
|
|||
#include "optlist.h"
|
||||
#include "plague.h"
|
||||
|
||||
static int explore_map(coord curx, coord cury, char *arg);
|
||||
static int explore_map(coord, coord, char *, char *);
|
||||
|
||||
int
|
||||
explore(void)
|
||||
|
@ -274,7 +274,7 @@ explore(void)
|
|||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
explore_map(coord curx, coord cury, char *arg)
|
||||
explore_map(coord curx, coord cury, char *arg1, char *arg2)
|
||||
{
|
||||
struct nstr_sect ns;
|
||||
struct sctstr sect;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue