- fix construction of FActorInfo.

For some reason this lost the copy constructing part from GZDoom resulting in bad data.
This commit is contained in:
Christoph Oelckers 2022-11-14 18:15:58 +01:00
parent 5fea500f92
commit 5aac77784a
2 changed files with 19 additions and 2 deletions

View file

@ -77,7 +77,14 @@ public:
void InitializeValue(void *addr, const void *def) const override
{
new(addr) FActorInfo;
if (def == nullptr)
{
new(addr) FActorInfo;
}
else
{
new(addr) FActorInfo(*(const FActorInfo*)def);
}
}
void DestroyValue(void *addr) const override

View file

@ -50,7 +50,17 @@ struct FActorInfo
TArray<FString> SpriteSetNames;
FActorInfo() = default;
FActorInfo(const FActorInfo & other) = delete;
FActorInfo(const FActorInfo& other)
{
// only copy the fields that get inherited
TypeNum = other.TypeNum;
DefaultFlags = other.DefaultFlags;
DefaultCstat = other.DefaultCstat;
defsprite = other.defsprite;
PicName = other.PicName;
SpriteSetNames = other.SpriteSetNames;
}
void ResolveTextures(const char* clsname);
};