Skip to content

Commit

Permalink
fix for scrake rage not working
Browse files Browse the repository at this point in the history
  • Loading branch information
theengineertcr committed Nov 11, 2023
1 parent cbb84f3 commit ba049b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
26 changes: 13 additions & 13 deletions Classes/AdvSawZombieController.uc
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ function bool FireWeaponAt(Actor A) {
return false;
}

if (VSize(Pawn.Location - A.Location) < 300) {
aFacing = Normal(Vector(Pawn.Rotation));
TargetFacing = Normal(Vector(A.Rotation));

// Get the vector from A to B
aToB = A.Location - Pawn.Location;
BToa = Pawn.Location - A.Location;
aFacing = Normal(Vector(Pawn.Rotation));
TargetFacing = Normal(Vector(A.Rotation));

RelativeDir = aFacing dot aToB;
TargetRelativeDir = TargetFacing dot BToa;
// Get the vector from A to B
aToB = A.Location - Pawn.Location;
BToa = Pawn.Location - A.Location;

if (RelativeDir < -15) {
bFacingTarget = false;
} else {
bFacingTarget = true;
}
RelativeDir = aFacing dot aToB;
TargetRelativeDir = TargetFacing dot BToa;

if (RelativeDir < -15) {
bFacingTarget = false;
} else {
bFacingTarget = true;
}


if (CanAttack(A)) {
Target = A;
Expand Down
12 changes: 4 additions & 8 deletions Classes/AdvZombieScrake.uc
Original file line number Diff line number Diff line change
Expand Up @@ -211,24 +211,20 @@ function bool MeleeDamageTarget(int hitdamage, vector pushdir) {
}
}

if ( KFHumanPawn(Controller.Target) != none )
{
if ( KFHumanPawn(Controller.Target) != none ) {
//TODO - line below was KFPawn. Does this whole block need to be KFPawn, or is it OK as KFHumanPawn?
KFHumanPawn(Controller.Target).TakeDamage(hitdamage, Instigator ,HitLocation,pushdir, CurrentDamType); //class 'KFmod.ZombieMeleeDamage');

if (KFHumanPawn(Controller.Target).Health <=0)
{
if ( !class'GameInfo'.static.UseLowGore() )
{
if (KFHumanPawn(Controller.Target).Health <=0) {
if ( !class'GameInfo'.static.UseLowGore() ) {
BloodHit = Spawn(class'KFMod.FeedingSpray',self,,Controller.Target.Location,rotator(pushdir)); //
KFHumanPawn(Controller.Target).SpawnGibs(rotator(pushdir), 1);
TearBone=KFPawn(Controller.Target).GetClosestBone(HitLocation,Velocity,dummy);
KFHumanPawn(Controller.Target).HideBone(TearBone);
}

// Give us some Health back
if (Health <= (1.0-FeedThreshold)*HealthMax)
{
if (Health <= (1.0-FeedThreshold)*HealthMax) {
Health += FeedThreshold*HealthMax * Health/HealthMax;
}
}
Expand Down

0 comments on commit ba049b3

Please sign in to comment.