mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 21:31:03 +00:00
- fixed loading of Blood savegames.
This was a strange case of C++ not doing what was to be expected due to hidden semantics. Note: never assign {} to a type that has a non-default constructor! Fixes #212
This commit is contained in:
parent
d04013066c
commit
2f4abf93af
2 changed files with 6 additions and 3 deletions
|
@ -25,7 +25,11 @@ public:
|
||||||
DBloodActor() :index(int(this - base())) { /*assert(index >= 0 && index < kMaxSprites);*/ }
|
DBloodActor() :index(int(this - base())) { /*assert(index >= 0 && index < kMaxSprites);*/ }
|
||||||
DBloodActor& operator=(const DBloodActor& other) = default;
|
DBloodActor& operator=(const DBloodActor& other) = default;
|
||||||
|
|
||||||
bool hasX() { return sprite[index].extra > 0; }
|
void Clear()
|
||||||
|
{
|
||||||
|
dudeSlope = 0;
|
||||||
|
}
|
||||||
|
bool hasX() { return sprite[index].extra > 0; }
|
||||||
spritetype& s() { return sprite[index]; }
|
spritetype& s() { return sprite[index]; }
|
||||||
XSPRITE& x() { return xsprite[sprite[index].extra]; } // calling this does not validate the xsprite!
|
XSPRITE& x() { return xsprite[sprite[index].extra]; } // calling this does not validate the xsprite!
|
||||||
SPRITEHIT& hit() { return gSpriteHit[sprite[index].extra]; }
|
SPRITEHIT& hit() { return gSpriteHit[sprite[index].extra]; }
|
||||||
|
|
|
@ -443,12 +443,11 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, DBloodActor& w, DB
|
||||||
if (!def)
|
if (!def)
|
||||||
{
|
{
|
||||||
def = &nul;
|
def = &nul;
|
||||||
if (arc.isReading()) w = {};
|
if (arc.isReading()) w.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arc.BeginObject(keyname))
|
if (arc.BeginObject(keyname))
|
||||||
{
|
{
|
||||||
|
|
||||||
// The rest is only relevant if the actor has an xsprite.
|
// The rest is only relevant if the actor has an xsprite.
|
||||||
if (w.s().extra > 0)
|
if (w.s().extra > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue