(natarg): Use new cnumb() values to improve diagnostics.

This commit is contained in:
Markus Armbruster 2006-01-06 20:11:14 +00:00
parent 87aa405823
commit ba554cbb1f

View file

@ -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);