Skip to content

Commit

Permalink
- fixed melee attack disance being off after adding MBF21 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Sep 17, 2021
1 parent 6795883 commit 08baad6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion wadsrc/static/zscript/actors/actor.zs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Actor : Thinker native
const ORIG_FRICTION = (0xE800/65536.); // original value
const ORIG_FRICTION_FACTOR = (2048/65536.); // original value
const DEFMORPHTICS = 40 * TICRATE;
const MELEEDELTA = 20;


// flags are not defined here, the native fields for those get synthesized from the internal tables.
Expand Down Expand Up @@ -380,7 +381,7 @@ class Actor : Thinker native
RenderStyle 'Normal';
Alpha 1;
MinMissileChance 200;
MeleeRange 64 - 20;
MeleeRange 64 - MELEEDELTA;
MaxDropoffHeight 24;
MaxStepHeight 24;
MaxSlopeSteepness STEEPSLOPE;
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponchainsaw.zs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extend class StateProvider
}
if (range == 0)
{
range = MeleeRange + (1. / 65536.); // MBF21 SAWRANGE;
range = MeleeRange + MELEEDELTA + (1. / 65536.); // MBF21 SAWRANGE;
}

double ang = angle + spread_xy * (Random2[Saw]() / 255.);
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponfist.zs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ extend class Actor
damage *= 10;

double ang = angle + Random2[Punch]() * (5.625 / 256);
double pitch = AimLineAttack (ang, MeleeRange, null, 0., ALF_CHECK3D);
double pitch = AimLineAttack (ang, MeleeRange + MELEEDELTA, null, 0., ALF_CHECK3D);

LineAttack (ang, MeleeRange, pitch, damage, 'Melee', "BulletPuff", LAF_ISMELEEATTACK, t);

Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/mbf21.zs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ extend class Weapon
// slight randomization; weird vanillaism here. :P
FTranslatedLineTarget t;
double ang = angle + Random2[mbf21]() * (5.625 / 256);
double pitch = AimLineAttack(ang, MeleeRange, t, 0., ALF_CHECK3D);
double pitch = AimLineAttack(ang, range + MELEEDELTA, t, 0., ALF_CHECK3D);
LineAttack(ang, range, pitch, damage, 'Melee', "BulletPuff", LAF_ISMELEEATTACK, t);

// turn to face target
Expand Down

0 comments on commit 08baad6

Please sign in to comment.