- replace FireProj struct with a second temp_pos vector

We’re going to need this anyway for some SE’s.
This commit is contained in:
Christoph Oelckers 2022-09-13 19:58:17 +02:00
parent dfd098d719
commit 2bcc552ce0
3 changed files with 5 additions and 30 deletions

View file

@ -1319,10 +1319,8 @@ static bool movefireball(DDukeActor* actor)
{
if (trail)
{
FireProj* proj = &trail->fproj;
ball->spr.pos = trail->temp_pos;
ball->set_int_xvel(proj->vel.X);
ball->set_int_zvel(proj->vel.Z);
ball->vel = trail->temp_pos2;
}
}
ball->spr.yrepeat = ball->spr.xrepeat = (uint8_t)(actor->spr.xrepeat * siz);
@ -1330,7 +1328,7 @@ static bool movefireball(DDukeActor* actor)
ball->spr.extra = 0;
ball->temp_pos = ball->spr.pos;
ball->fproj.vel = { ball->int_xvel(), 0, ball->int_zvel()};
ball->temp_pos2 = ball->vel;
ChangeActorStat(ball, STAT_PROJECTILE);
}

View file

@ -47,20 +47,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, GameVarValue& w, G
void lava_serialize(FSerializer& arc);
void SerializeGameVars(FSerializer &arc);
static FSerializer& Serialize(FSerializer& arc, const char* key, FireProj& p, FireProj* def)
{
if (arc.BeginObject(key))
{
arc
("xv", p.vel.X)
("yv", p.vel.Y)
("zv", p.vel.Z)
.EndObject();
}
return arc;
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, CraneDef& w, CraneDef* def)
{
if (arc.BeginObject(keyname))
@ -314,12 +300,11 @@ void DDukeActor::Serialize(FSerializer& arc)
.Array("temo_wall", temp_walls, 2)
("temp_angle", temp_angle)
("temp_pos", temp_pos)
("temp_pos2", temp_pos2)
("temp_sect", temp_sect)
("uservars", uservars)
("flags1", flags1)
("flags2", flags2)
("fireproj", fproj);
("flags2", flags2);
}

View file

@ -21,11 +21,6 @@ struct STATUSBARTYPE
bool gotweapon[MAX_WEAPONS];
};
struct FireProj
{
vec3_t vel;
};
// Todo - put more state in here
struct ActorInfo
{
@ -64,7 +59,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, SE_26 and FIREBALL.
DVector3 temp_pos, temp_pos2; // used by TRIPBOMB, SE_26 and FIREBALL.
TObjPtr<DDukeActor*> temp_actor, seek_actor;
@ -73,9 +68,6 @@ public:
EDukeFlags1 flags1;
EDukeFlags2 flags2;
// Todo: Once we start assigning subclasses to actors, this one needs to be moved to the proper FIREBALL subclass.
FireProj fproj;
DDukeActor() = default;
size_t PropagateMark() override;
const ActorInfo* actorInfo() const;