]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/natsub.c
Permit no-op country name change again
[empserver] / src / lib / subs / natsub.c
index 17da9c8fa3c0f83bf405e530e355f9150f6c5f2d..d5777f202944704e8c5040f591e39cc24661362c 100644 (file)
@@ -27,7 +27,7 @@
  *  nat.c: Nation subroutines
  *
  *  Known contributors to this file:
  *  nat.c: Nation subroutines
  *
  *  Known contributors to this file:
- *     Markus Armbruster, 2009
+ *     Markus Armbruster, 2009-2011
  *     Ron Koenderink, 2008-2009
  */
 
  *     Ron Koenderink, 2008-2009
  */
 
@@ -117,7 +117,7 @@ nat_reset(struct natstr *natp, enum nat_status stat, coord x, coord y)
 }
 
 int
 }
 
 int
-check_nat_name(char *cname)
+check_nat_name(char *cname, natid cnum)
 {
     struct natstr *natp;
     natid cn;
 {
     struct natstr *natp;
     natid cn;
@@ -143,7 +143,7 @@ check_nat_name(char *cname)
     }
 
     for (cn = 0; NULL != (natp = getnatp(cn)); cn++) {
     }
 
     for (cn = 0; NULL != (natp = getnatp(cn)); cn++) {
-       if (!strcmp(cname, natp->nat_cnam)) {
+       if (cn != cnum && !strcmp(cname, natp->nat_cnam)) {
            pr("Country #%d is already called `%s'\n", cn, cname);
            return 0;
        }
            pr("Country #%d is already called `%s'\n", cn, cname);
            return 0;
        }