]> git.pond.sub.org Git - empserver/commitdiff
Fix test for capability engineer in lnd_hit_mine() hvy-plastic-2 hvy-plastic-2.3
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:45:21 +0000 (23:45 +0200)
Bogus array index, unpredictable result, can crash the server.  Broken
in commit ef7ea893, v4.3.24.
(cherry picked from commit 7506039f1b31eeaddab436831d23fb50c2f9409b)

src/lib/subs/lndsub.c

index a19e53dc28db4363a45879de33e72dfa9f2edf9d..a5808e7ce13be3cad32a652523999438ed801797 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);