mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-23 20:42:45 +00:00
- added mapSpawned member to DDukeActor
Duke uses the owner a lot to check if an actor was spawned at map start or in-game, but that depends a lot on stale pointers being maintained, which our garbage collected system does not allow. So this field now serves as a more reliable stand-in for these cases. No actual changes yet.
This commit is contained in:
parent
9c1fc93e1c
commit
13e6718153
6 changed files with 6 additions and 0 deletions
|
@ -259,6 +259,7 @@ void cacheit_d(void)
|
|||
//---------------------------------------------------------------------------
|
||||
void spriteinit_d(DDukeActor* actor, TArray<DDukeActor*>& actors)
|
||||
{
|
||||
actor->mapSpawned = true;
|
||||
bool res = initspriteforspawn(actor);
|
||||
if (res) spawninit_d(nullptr, actor, &actors);
|
||||
}
|
||||
|
|
|
@ -399,6 +399,7 @@ void cacheit_r(void)
|
|||
|
||||
void spriteinit_r(DDukeActor* actor, TArray<DDukeActor*>& actors)
|
||||
{
|
||||
actor->mapSpawned = true;
|
||||
bool res = initspriteforspawn(actor);
|
||||
if (res) spawninit_r(nullptr, actor, &actors);
|
||||
}
|
||||
|
|
|
@ -270,6 +270,7 @@ void DDukeActor::Serialize(FSerializer& arc)
|
|||
("actorstayput", actorstayput)
|
||||
("basepicnum", basepicnum)
|
||||
("timetosleep", timetosleep)
|
||||
("mapspawned", mapSpawned)
|
||||
("floorz", floorz)
|
||||
("ceilingz", ceilingz)
|
||||
("lastvx", ovel.X)
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
short attackertype, hitextra;
|
||||
short tempval, basepicnum;
|
||||
unsigned short timetosleep;
|
||||
bool mapSpawned;
|
||||
DVector2 ovel;
|
||||
DAngle hitang;
|
||||
double floorz, ceilingz;
|
||||
|
|
|
@ -224,6 +224,7 @@ DEFINE_FIELD(DDukeActor, hitextra)
|
|||
DEFINE_FIELD(DDukeActor, movflag)
|
||||
DEFINE_FIELD(DDukeActor, tempval)
|
||||
DEFINE_FIELD(DDukeActor, timetosleep)
|
||||
DEFINE_FIELD(DDukeActor, mapSpawned)
|
||||
DEFINE_FIELD(DDukeActor, floorz)
|
||||
DEFINE_FIELD(DDukeActor, ceilingz)
|
||||
DEFINE_FIELD(DDukeActor, saved_ammo)
|
||||
|
|
|
@ -125,6 +125,7 @@ class DukeActor : CoreActor native
|
|||
native int16 /*attackertype, hitang,*/ hitextra, movflag;
|
||||
native int16 tempval; /*, dispicnum;*/
|
||||
native int16 timetosleep;
|
||||
native bool mapSpawned;
|
||||
native double floorz, ceilingz;
|
||||
native int saved_ammo;
|
||||
native int palvals;
|
||||
|
|
Loading…
Reference in a new issue