- reimplemented autoaim mode 2 (hitscan only)

This commit is contained in:
Christoph Oelckers 2020-07-26 09:06:08 +02:00
parent efb73d04a0
commit c7a9b5678b
2 changed files with 29 additions and 5 deletions

View file

@ -281,16 +281,39 @@ int aim(spritetype* s, int aang)
{ {
char gotshrinker, gotfreezer; char gotshrinker, gotfreezer;
int i, j, a, k, cans; int i, j, a, k, cans;
int aimstats[] = { 10,13,1,2 }; int aimstats[] = { STAT_PLAYER, STAT_DUMMYPLAYER, STAT_ACTOR, STAT_ZOMBIEACTOR };
int dx1, dy1, dx2, dy2, dx3, dy3, smax, sdist; int dx1, dy1, dx2, dy2, dx3, dy3, smax, sdist;
int xv, yv; int xv, yv;
a = s->ang; a = s->ang;
// Autoaim from DukeGDX. // Autoaim from DukeGDX.
if (s->picnum == TILE_APLAYER && ps[s->yvel].auto_aim == 0) if (s->picnum == TILE_APLAYER)
return -1; {
if (ps[s->yvel].auto_aim == 0)
{
// The chickens in RRRA are homing and must always autoaim.
if (!isRRRA() || ps[s->yvel].curr_weapon != CHICKEN_WEAPON)
return -1;
}
else if (ps[s->yvel].auto_aim == 2)
{
int weap;
if (!isWW2GI())
{
weap = ps[s->yvel].curr_weapon;
}
else
{
weap = aplWeaponWorksLike[ps[s->yvel].curr_weapon][s->yvel];
}
if (weap > CHAINGUN_WEAPON || weap == KNEE_WEAPON)
{
return -1;
}
}
}
j = -1; j = -1;
// if(s->picnum == TILE_APLAYER && ps[s->yvel].aim_mode) return -1; // if(s->picnum == TILE_APLAYER && ps[s->yvel].aim_mode) return -1;

View file

@ -507,10 +507,11 @@ void resetprestat(int snum,int g)
void resetpspritevars(int g) void resetpspritevars(int g)
{ {
short i, j, nexti, circ; int i, j;
short nexti, circ;
int firstx, firsty; int firstx, firsty;
spritetype* s; spritetype* s;
char aimmode[MAXPLAYERS], autoaim[MAXPLAYERS]; int aimmode[MAXPLAYERS], autoaim[MAXPLAYERS];
STATUSBARTYPE tsbar[MAXPLAYERS]; STATUSBARTYPE tsbar[MAXPLAYERS];
EGS(ps[0].cursectnum, ps[0].posx, ps[0].posy, ps[0].posz, EGS(ps[0].cursectnum, ps[0].posx, ps[0].posy, ps[0].posz,