@@ -4151,25 +4151,34 @@ namespace server
41514151 {
41524152 statalt = m->lastresalt [WR_BURN];
41534153 statweap = m->lastresweapon [WR_BURN];
4154- if (statalt) v->weapstats [statweap].damage2 += realdamage;
4155- else v->weapstats [statweap].damage1 += realdamage;
4154+ if (isweap (statweap))
4155+ {
4156+ if (statalt) v->weapstats [statweap].damage2 += realdamage;
4157+ else v->weapstats [statweap].damage1 += realdamage;
4158+ }
41564159 }
41574160 if (flags&HIT_BLEED)
41584161 {
41594162 statalt = m->lastresalt [WR_BLEED];
41604163 statweap = m->lastresweapon [WR_BLEED];
4161- if (statalt) v->weapstats [statweap].damage2 += realdamage;
4162- else v->weapstats [statweap].damage1 += realdamage;
4164+ if (isweap (statweap))
4165+ {
4166+ if (statalt) v->weapstats [statweap].damage2 += realdamage;
4167+ else v->weapstats [statweap].damage1 += realdamage;
4168+ }
41634169 }
41644170 if (flags&HIT_SHOCK)
41654171 {
41664172 statalt = m->lastresalt [WR_SHOCK];
41674173 statweap = m->lastresweapon [WR_SHOCK];
4168- if (statalt) v->weapstats [statweap].damage2 += realdamage;
4169- else v->weapstats [statweap].damage1 += realdamage;
4174+ if (isweap (statweap))
4175+ {
4176+ if (statalt) v->weapstats [statweap].damage2 += realdamage;
4177+ else v->weapstats [statweap].damage1 += realdamage;
4178+ }
41704179 }
41714180 }
4172- else
4181+ else if ( isweap (statweap))
41734182 {
41744183 if (statalt) v->weapstats [statweap].damage2 += realdamage;
41754184 else v->weapstats [statweap].damage1 += realdamage;
@@ -4197,7 +4206,7 @@ namespace server
41974206 m->lastresweapon [WR_SHOCK] = fromweap;
41984207 m->lastresalt [WR_SHOCK] = statalt;
41994208 }
4200- if (isweap (weap ) && m != v && (!m_team (gamemode, mutators) || m->team != v->team ) && first)
4209+ if (isweap (statweap ) && m != v && (!m_team (gamemode, mutators) || m->team != v->team ) && first)
42014210 {
42024211 if (WK (flags))
42034212 {
@@ -4225,8 +4234,11 @@ namespace server
42254234 v->frags ++;
42264235 v->totalfrags ++;
42274236 v->localtotalfrags ++;
4228- if (statalt) v->weapstats [statweap].frags2 ++;
4229- else v->weapstats [statweap].frags1 ++;
4237+ if (isweap (statweap))
4238+ {
4239+ if (statalt) v->weapstats [statweap].frags2 ++;
4240+ else v->weapstats [statweap].frags1 ++;
4241+ }
42304242 }
42314243 else fragvalue = -fragvalue;
42324244 bool isai = m->actortype >= A_ENEMY, isteamkill = false ;
0 commit comments