Fix test for capability engineer in lnd_hit_mine()
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 7 Apr 2010 21:35:25 +0000 (23:35 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 7 Apr 2010 21:35:25 +0000 (23:35 +0200)
Bogus array index, unpredictable result, can crash the server.  Broken
in commit ef7ea893, v4.3.24.

src/lib/subs/lndsub.c

index 2f5134e8647db04ab8629b0f34c7577f6f3ceee1..4b0cec14b330edc234044f3a8d421a298b393b06 100644 (file)
@@ -862,7 +862,7 @@ lnd_hit_mine(struct lndstr *lp)
     nreport(lp->lnd_own, N_LHIT_MINE, 0, 1);
 
     m = MINE_LDAMAGE();
-    if (lchr[lp->lnd_uid].l_flags & L_ENGINEER)
+    if (lchr[lp->lnd_type].l_flags & L_ENGINEER)
        m /= 2;
 
     landdamage(lp, m);