- use temp_pos instead of maintaining yet another variable for FIREBALL

This commit is contained in:
Christoph Oelckers 2022-08-30 21:36:30 +02:00
parent 559c24fa92
commit 06e86735fc
3 changed files with 6 additions and 7 deletions

View file

@ -1321,7 +1321,7 @@ static bool movefireball(DDukeActor* actor)
if (trail)
{
FireProj* proj = &trail->fproj;
ball->set_int_pos(proj->pos);
ball->spr.pos = trail->temp_pos;
ball->spr.xvel = proj->vel.X;
ball->spr.yvel = proj->vel.Y;
ball->spr.zvel = proj->vel.Z;
@ -1331,7 +1331,8 @@ static bool movefireball(DDukeActor* actor)
ball->spr.cstat = actor->spr.cstat;
ball->spr.extra = 0;
ball->fproj = { ball->int_pos(), { ball->spr.xvel, ball->spr.yvel, ball->spr.zvel } };
ball->temp_pos = ball->spr.pos;
ball->fproj.vel = { ball->spr.xvel, ball->spr.yvel, ball->spr.zvel };
ChangeActorStat(ball, STAT_PROJECTILE);
}

View file

@ -51,9 +51,7 @@ static FSerializer& Serialize(FSerializer& arc, const char* key, FireProj& p, Fi
{
if (arc.BeginObject(key))
{
arc("x", p.pos.X)
("y", p.pos.Y)
("z", p.pos.Z)
arc
("xv", p.vel.X)
("yv", p.vel.Y)
("zv", p.vel.Z)

View file

@ -23,7 +23,7 @@ struct STATUSBARTYPE
struct FireProj
{
vec3_t pos, vel;
vec3_t vel;
};
// Todo - put more state in here
@ -63,7 +63,7 @@ public:
walltype* temp_walls[2]; // SE20 + SE128
sectortype* temp_sect, *actorstayput;
DAngle temp_angle; // only used by TRIPBOMB
DVector3 temp_pos; // used by TRIPBOMB and SE_26.
DVector3 temp_pos; // used by TRIPBOMB, SE_26 and FIREBALL.
TObjPtr<DDukeActor*> temp_actor, seek_actor;