fixed: AActor's members must all be native.

The morph code added 4 scripted ones, but AActor's size must be known at compile time.
This commit is contained in:
Christoph Oelckers 2024-04-25 18:14:39 +02:00
parent 572ba9f515
commit 347cb724e3
4 changed files with 21 additions and 6 deletions

View file

@ -1362,18 +1362,23 @@ public:
DVector3 Prev;
DRotator PrevAngles;
DAngle PrevFOV;
int PrevPortalGroup;
TArray<FDynamicLight *> AttachedLights;
TDeletingArray<FLightDefaults *> UserLights;
int PrevPortalGroup;
// When was this actor spawned?
int SpawnTime;
uint32_t SpawnOrder;
int UnmorphTime;
int MorphFlags;
int PremorphProperties;
PClassActor* MorphExitFlash;
// landing speed from a jump with normal gravity (squats the player's view)
// (note: this is put into AActor instead of the PlayerPawn because non-players also use the value)
double LandingSpeed;
// ThingIDs
void SetTID (int newTID);

View file

@ -393,7 +393,13 @@ void AActor::Serialize(FSerializer &arc)
A("userlights", UserLights)
A("WorldOffset", WorldOffset)
("modelData", modelData)
A("LandingSpeed", LandingSpeed);
A("LandingSpeed", LandingSpeed)
("unmorphtime", UnmorphTime)
("morphflags", MorphFlags)
("premorphproperties", PremorphProperties)
("morphexitflash", MorphExitFlash);
SerializeTerrain(arc, "floorterrain", floorterrain, &def->floorterrain);
SerializeArgs(arc, "args", args, def->args, special);

View file

@ -2126,6 +2126,10 @@ DEFINE_FIELD(AActor, ShadowAimFactor)
DEFINE_FIELD(AActor, ShadowPenaltyFactor)
DEFINE_FIELD(AActor, AutomapOffsets)
DEFINE_FIELD(AActor, LandingSpeed)
DEFINE_FIELD(AActor, UnmorphTime)
DEFINE_FIELD(AActor, MorphFlags)
DEFINE_FIELD(AActor, PremorphProperties)
DEFINE_FIELD(AActor, MorphExitFlash)
DEFINE_FIELD_X(FCheckPosition, FCheckPosition, thing);
DEFINE_FIELD_X(FCheckPosition, FCheckPosition, pos);

View file

@ -35,10 +35,10 @@ extend class Actor
MPROP_INVIS = 1 << 6,
}
int UnmorphTime;
EMorphFlags MorphFlags;
class<Actor> MorphExitFlash;
EPremorphProperty PremorphProperties;
native int UnmorphTime;
native int MorphFlags;
native class<Actor> MorphExitFlash;
native int PremorphProperties;
// Players still track these separately for legacy reasons.
void SetMorphStyle(EMorphFlags flags)