(natarg): Use new cnumb() values to improve diagnostics.
This commit is contained in:
parent
87aa405823
commit
ba554cbb1f
1 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,7 @@
|
||||||
#include "nat.h"
|
#include "nat.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
#include "match.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
|
@ -63,8 +64,13 @@ natarg(char *arg, char *prompt)
|
||||||
return -1;
|
return -1;
|
||||||
if (isdigit(*arg))
|
if (isdigit(*arg))
|
||||||
n = atoi(arg);
|
n = atoi(arg);
|
||||||
else
|
else {
|
||||||
n = cnumb(arg);
|
n = cnumb(arg);
|
||||||
|
if (n == M_NOTUNIQUE) {
|
||||||
|
pr("Country '%s' is ambiguous\n", arg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
np = getnatp(n);
|
np = getnatp(n);
|
||||||
if (!np) {
|
if (!np) {
|
||||||
pr("Country '%s' doesn't exist.\n", arg);
|
pr("Country '%s' doesn't exist.\n", arg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue