Fix test for capability sweep in shp_hit_mine()

Bogus array index, unpredictable result, can crash the server.  Broken
in commit ef7ea893, v4.3.24.
(cherry picked from commit 054eba7a1d)
This commit is contained in:
Markus Armbruster 2010-03-21 09:26:37 +01:00
parent e0b21266ce
commit b62025e82c

View file

@ -708,7 +708,7 @@ shp_hit_mine(struct shpstr *sp)
nreport(sp->shp_own, N_HIT_MINE, 0, 1); nreport(sp->shp_own, N_HIT_MINE, 0, 1);
m = MINE_DAMAGE(); m = MINE_DAMAGE();
if (mchr[sp->shp_uid].m_flags & M_SWEEP) if (mchr[sp->shp_type].m_flags & M_SWEEP)
m /= 2.0; m /= 2.0;
shipdamage(sp, ldround(m, 1)); shipdamage(sp, ldround(m, 1));