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.
This commit is contained in:
Markus Armbruster 2010-03-21 09:26:37 +01:00
parent 83c4d37ade
commit 054eba7a1d

View file

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