mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- Exhumed: Don't autoaim backwards.
This commit is contained in:
parent
88fe8e49a3
commit
395de23b21
1 changed files with 13 additions and 4 deletions
|
@ -815,16 +815,25 @@ loc_flag:
|
|||
}
|
||||
case kWeaponPistol:
|
||||
{
|
||||
int var_50 = PlayerList[nLocalPlayer].horizon.horiz.asq16() >> 14;
|
||||
nHeight -= var_50;
|
||||
int h = PlayerList[nLocalPlayer].horizon.horiz.asq16() >> 14;
|
||||
nHeight -= h;
|
||||
|
||||
int target = 0;
|
||||
if (sPlayerInput[nPlayer].nTarget >= 0 && Autoaim(nPlayer))
|
||||
{
|
||||
assert(sprite[sPlayerInput[nPlayer].nTarget].sectnum < kMaxSectors);
|
||||
var_50 = sPlayerInput[nPlayer].nTarget + 10000;
|
||||
int t = sPlayerInput[nPlayer].nTarget;
|
||||
if (t >= 0 && t < MAXSPRITES)
|
||||
{
|
||||
// only autoaim if target is in front of the player.
|
||||
auto pTargetSprite = &sprite[t];
|
||||
int angletotarget = bvectangbam(pTargetSprite->x - sprite[nPlayerSprite].x, pTargetSprite->y - sprite[nPlayerSprite].y).asbuild();
|
||||
int anglediff = (sprite[nPlayerSprite].ang - angletotarget) & 2047;
|
||||
if (anglediff < 512 || anglediff > 1536) target = t + 10000;
|
||||
}
|
||||
}
|
||||
|
||||
BuildBullet(nPlayerSprite, nAmmoType, ebp, ebx, nHeight, nAngle, var_50, var_1C);
|
||||
BuildBullet(nPlayerSprite, nAmmoType, ebp, ebx, nHeight, nAngle, target, var_1C);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue