Fix gibhealth issues once and for all.

This commit is contained in:
Mari the Deer 2021-10-30 11:39:10 +02:00
commit 7ae8722110
3 changed files with 6 additions and 9 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.37 \cu(Mon 25 Oct 16:30:00 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.37 \cu(2021-10-25 16:30:00)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.38 \cu(Sat 30 Oct 11:41:08 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.38 \cu(2021-10-30 11:41:08)\c-";

View file

@ -32,7 +32,7 @@ Class SpreadgunTracer : LineTracer
{
int amt = SWWMDamageAccumulator.GetAmount(Results.HitActor);
// getgibhealth isn't clearscope, fuck
int gibh = (Results.HitActor.GibHealth!=int.min)?Results.HitActor.GibHealth:-int(Results.HitActor.GetSpawnHealth()*gameinfo.gibfactor);
int gibh = (Results.HitActor.GibHealth!=int.min)?-abs(Results.HitActor.GibHealth):-int(Results.HitActor.GetSpawnHealth()*gameinfo.gibfactor);
// if gibbed, go through without dealing more damage
if ( Results.HitActor.health-amt <= gibh ) return TRACE_Skip;
let ent = new("HitListEntry");
@ -95,7 +95,8 @@ Class SpreadSlugTracer : SpreadgunTracer
}
else
{
ent.hitdamage = min(Results.HitActor.health+int(Results.HitActor.GetSpawnHealth()*gameinfo.gibfactor),int(penetration));
int gibh = (Results.HitActor.GibHealth!=int.min)?-abs(Results.HitActor.GibHealth):-int(Results.HitActor.GetSpawnHealth()*gameinfo.gibfactor);
ent.hitdamage = min(Results.HitActor.health+abs(gibh),int(penetration));
penetration = max(0,penetration-ent.hitdamage);
}
hitlist.Push(ent);

View file

@ -60,15 +60,11 @@ Class SilverBulletTracer : SpreadSlugTracer
ent.hitlocation = Results.HitPos;
ent.x = Results.HitVector;
ent.pastwall = pastwall;
ent.hitdamage = int(penetration);
if ( (Results.HitActor.Health >= int(penetration)) || Results.HitActor.bNODAMAGE )
{
ent.hitdamage = int(penetration);
penetration = 0;
}
else
{
int gibh = (Results.HitActor.GibHealth!=int.min)?Results.HitActor.GibHealth:-int(Results.HitActor.GetSpawnHealth()*gameinfo.gibfactor);
ent.hitdamage = min(Results.HitActor.health-int(gibh*1.5),int(penetration));
int killdamage = min(Results.HitActor.health,int(penetration));
penetration = max(0,penetration-killdamage*.4);
}