]> git.pond.sub.org Git - empserver/commitdiff
Fix map drawing commands to report bad unit arguments
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 10 Apr 2011 07:14:29 +0000 (09:14 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Apr 2011 18:21:22 +0000 (20:21 +0200)
Before, they failed without explanation when they interpreted the
argument as unit number, but the player didn't own that unit.

src/lib/subs/maps.c

index 67b40b74873afa27ae92fdc730aacc12f97e45df..fb63031dbe8be51119cb52cd4960b4d63fa42d20 100644 (file)
@@ -92,8 +92,10 @@ do_map(int bmap, int unit_type, char *arg, char *map_flags_arg)
            return RET_SYN;
        break;
     default:
-       if (unit_map(unit_type, atoi(arg), &ns, &origin) < 0)
+       if (unit_map(unit_type, atoi(arg), &ns, &origin) < 0) {
+           pr("No such %s\n", ef_nameof(unit_type));
            return RET_FAIL;
+       }
     }
 
     map_flags = parse_map_flags(bmap, map_flags_arg);