]> git.pond.sub.org Git - empserver/commitdiff
Make bestpath work for deities in foreign land
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 18 Feb 2011 18:29:29 +0000 (19:29 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 11 Apr 2011 20:29:13 +0000 (22:29 +0200)
Before, it only worked in land owned by the deity.

As always, paths can't cross international borders.

src/lib/commands/best.c

index d989a14cf229b85db78a839a10e85ffc4e69f039..a72837132e605bcf0331a5f319ae43df00a88784 100644 (file)
@@ -52,11 +52,11 @@ best(void)
        return RET_SYN;
 
     while (!player->aborted && nxtsct(&nstr, &s1)) {
        return RET_SYN;
 
     while (!player->aborted && nxtsct(&nstr, &s1)) {
-       if (s1.sct_own != player->cnum)
+       if (!player->owner)
            continue;
        snxtsct_rewind(&nstr2);
        while (!player->aborted && nxtsct(&nstr2, &s2)) {
            continue;
        snxtsct_rewind(&nstr2);
        while (!player->aborted && nxtsct(&nstr2, &s2)) {
-           if (s2.sct_own != player->cnum)
+           if (!player->owner)
                continue;
            path = BestLandPath(buf, &s1, &s2, &cost, MOB_MOVE);
            if (path)
                continue;
            path = BestLandPath(buf, &s1, &s2, &cost, MOB_MOVE);
            if (path)