]> git.pond.sub.org Git - empserver/commitdiff
subs: Drop unit_path() parameter together
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 Dec 2014 21:36:25 +0000 (22:36 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:13:15 +0000 (16:13 +0100)
It's always non-zero now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/unit.h
src/lib/commands/navi.c
src/lib/subs/unitsub.c

index 65f16c6d0e38e5160555bf09919a85dd8250e5bf..b544d7f91214c264e914df5ff17ac0700f330354 100644 (file)
@@ -58,7 +58,7 @@ extern void unit_onresize(int);
 
 extern char *unit_nameof(struct empobj *);
 extern void unit_list(struct emp_qelem *);
-extern char *unit_path(int, struct empobj *, char *, size_t);
+extern char *unit_path(struct empobj *, char *, size_t);
 extern void unit_view(struct emp_qelem *);
 extern void unit_teleport(struct empobj *, coord, coord);
 extern int unit_update_cargo(struct empobj *);
index 4773424b9493ec5ce16e61cd9e3149ea7f228959..db2b99f94c2c6c5d0285b9bb22e1563da32d5005 100644 (file)
@@ -87,7 +87,7 @@ do_unit_move(struct emp_qelem *ulist, double *minmob, double *maxmob)
 
     if (player->argp[2]) {
        strcpy(buf, player->argp[2]);
-       cp = unit_path(1, leader, buf, sizeof(buf));
+       cp = unit_path(leader, buf, sizeof(buf));
     }
 
     while (!QEMPTY(ulist)) {
@@ -138,7 +138,7 @@ do_unit_move(struct emp_qelem *ulist, double *minmob, double *maxmob)
                continue;
            }
            if (cp)
-               cp = unit_path(1, leader, buf, sizeof(buf));
+               cp = unit_path(leader, buf, sizeof(buf));
        }
        if (type == EF_SHIP) {
            rad_map_set(player->cnum, leader->x, leader->y, leader->effic,
index b89160371627264ddac19d895e51a15064fcf4b8..8dfac456182c85150b6362eee4d246eee49985a1 100644 (file)
@@ -117,7 +117,7 @@ unit_list(struct emp_qelem *unit_list)
 }
 
 char *
-unit_path(int together, struct empobj *unit, char *buf, size_t bufsz)
+unit_path(struct empobj *unit, char *buf, size_t bufsz)
 {
     coord destx;
     coord desty;
@@ -131,10 +131,6 @@ unit_path(int together, struct empobj *unit, char *buf, size_t bufsz)
 
     if (!sarg_xy(buf, &destx, &desty))
        return buf;
-    if (!together) {
-       pr("Cannot go to a destination sector if not all starting in the same sector\n");
-       return NULL;
-    }
     if (unit->ef_type == EF_SHIP) {
        c = path_find(unit->x, unit->y, destx, desty,
                      player->cnum, MOB_SAIL);