mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
- Blood: fixed AIState and posture data serialization
This commit is contained in:
parent
9a4073508d
commit
48049d5548
2 changed files with 9 additions and 1 deletions
|
@ -410,6 +410,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, AISTATE*& w, AISTA
|
|||
int i = 0;
|
||||
if (arc.isWriting())
|
||||
{
|
||||
if (def && w == *def) return arc;
|
||||
for (auto cstate : allAIStates)
|
||||
{
|
||||
if (w == cstate)
|
||||
|
@ -509,9 +510,16 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSECTOR& w, XSECTO
|
|||
|
||||
FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRITE* def)
|
||||
{
|
||||
static XSPRITE nul;
|
||||
if (!def)
|
||||
{
|
||||
def = &nul;
|
||||
if (arc.isReading()) w = {};
|
||||
}
|
||||
if (arc.BeginObject(keyname))
|
||||
{
|
||||
arc("flags", w.flags, def->flags)
|
||||
("aistate", w.aiState, def->aiState)
|
||||
("busy", w.busy, def->busy)
|
||||
("reference", w.reference, def->reference)
|
||||
("txid", w.txID, def->txID)
|
||||
|
|
|
@ -2300,7 +2300,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
|
|||
("angold", w.angold)
|
||||
("player_par", w.player_par)
|
||||
("waterpal", w.nWaterPal)
|
||||
.Array("posture", &w.pPosture[0][0], &gPostureDefaults[0][0], kModeMax * kPostureMax) // only save actual changes in this.
|
||||
.Array("posturedata", &w.pPosture[0][0], &gPostureDefaults[0][0], kModeMax * kPostureMax) // only save actual changes in this.
|
||||
.EndObject();
|
||||
}
|
||||
return arc;
|
||||
|
|
Loading…
Reference in a new issue