- eliminated add_int_change

This commit is contained in:
Christoph Oelckers 2022-09-05 00:13:15 +02:00
parent e42267f246
commit 77bc524950
3 changed files with 8 additions and 13 deletions

View file

@ -928,8 +928,6 @@ struct USER
void set_int_change_x(int x) { change.X = x * inttoworld; }
void set_int_change_y(int x) { change.Y = x * inttoworld; }
void set_int_change_z(int x) { change.Z = x * zinttoworld; }
void add_int_change_x(int x) { change.X += x * inttoworld; }
void add_int_change_y(int x) { change.Y += x * inttoworld; }
// frequently repeated patterns
void addCounterToChange() { change.Z += Counter * zinttoworld; }

View file

@ -1303,8 +1303,8 @@ int PlayerInitChemBomb(PLAYER* pp)
UpdateChange(actorNew, 0.5);
// adjust xvel according to player velocity
actorNew->user.add_int_change_x(pp->vect.X >> 14);
actorNew->user.add_int_change_y(pp->vect.Y >> 14);
actorNew->user.change.X += FixedToFloat<18>(pp->vect.X);
actorNew->user.change.Y += FixedToFloat<18>(pp->vect.Y);
// Smoke will come out for this many seconds
actorNew->user.WaitTics = CHEMTICS;
@ -1645,9 +1645,6 @@ int PlayerInitCaltrops(PLAYER* pp)
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// They go out at different angles
// spawnedActor->spr.ang = NORM_ANGLE(pp->angle.ang.Buildang() + (RandomRange(50) - 25));
actorNew->set_int_zvel(-pp->horizon.horiz.asq16() >> 9);
oclipdist = plActor->spr.clipdist;
@ -1662,8 +1659,8 @@ int PlayerInitCaltrops(PLAYER* pp)
UpdateChange(actorNew, 0.5);
// adjust xvel according to player velocity
actorNew->user.add_int_change_x(pp->vect.X >> 14);
actorNew->user.add_int_change_y(pp->vect.Y >> 14);
actorNew->user.change.X += FixedToFloat<18>(pp->vect.X);
actorNew->user.change.Y += FixedToFloat<18>(pp->vect.Y);
SetupSpriteForBreak(actorNew); // Put Caltrops in the break queue
return 0;

View file

@ -15877,8 +15877,8 @@ int InitGrenade(PLAYER* pp)
if (!auto_aim)
{
// adjust xvel according to player velocity
actorNew->user.add_int_change_x(pp->vect.X>>14);
actorNew->user.add_int_change_y(pp->vect.Y>>14);
actorNew->user.change.X += FixedToFloat<18>(pp->vect.X);
actorNew->user.change.Y += FixedToFloat<18>(pp->vect.Y);
}
actorNew->user.Counter2 = true; // Phosphorus Grenade
@ -15980,8 +15980,8 @@ int InitMine(PLAYER* pp)
if (abs(dot) > 10000)
{
// adjust xvel according to player velocity
actorNew->user.add_int_change_x(pp->vect.X>>13);
actorNew->user.add_int_change_y(pp->vect.Y>>13);
actorNew->user.change.X += FixedToFloat<18>(2 * pp->vect.X);
actorNew->user.change.Y += FixedToFloat<18>(2 * pp->vect.Y);
}
return 0;