- added temp_angle variable to DDukeActor

To avoid using temp_data as storage for angles in TRIPBOMB.
This commit is contained in:
Christoph Oelckers 2022-08-29 19:43:06 +02:00
parent 7ddfd944e6
commit aec74d5d0d
3 changed files with 3 additions and 4 deletions

View file

@ -3185,18 +3185,14 @@ void handle_se03(DDukeActor *actor)
int palvals = actor->palvals;
// if(actor->temp_data[5] > 0) { actor->temp_data[5]--; break; }
if ((global_random / (sh + 1) & 31) < 4 && !actor->temp_data[2])
{
// actor->temp_data[5] = 4+(global_random&7);
sc->ceilingpal = palvals >> 8;
sc->floorpal = palvals & 0xff;
actor->temp_data[0] = actor->spr.shade + (global_random & 15);
}
else
{
// actor->temp_data[5] = 4+(global_random&3);
sc->ceilingpal = actor->spr.pal;
sc->floorpal = actor->spr.pal;
actor->temp_data[0] = actor->temp_data[3];

View file

@ -314,6 +314,7 @@ void DDukeActor::Serialize(FSerializer& arc)
("seek_actor", seek_actor)
.Array("temp_data", temp_data, 6)
.Array("temo_wall", temp_walls, 2)
("temp_angle", temp_angle)
("temp_sect", temp_sect)
("uservars", uservars)
("flags1", flags1)

View file

@ -57,10 +57,12 @@ public:
int palvals;
int tempsound;
};
// note: all this temp shit needs to be moved to subclass specific variables once things get cleaned up. This is a major issue with code readability.
int temp_data[6];
// Some SE's stored indices in temp_data. For purposes of clarity avoid that. These variables are meant to store these elements now
walltype* temp_walls[2]; // SE20 + SE128
sectortype* temp_sect, *actorstayput;
DAngle temp_angle; // only used by TRIPBOMB
TObjPtr<DDukeActor*> temp_actor, seek_actor;