mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-12 14:55:36 +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;
|
int i = 0;
|
||||||
if (arc.isWriting())
|
if (arc.isWriting())
|
||||||
{
|
{
|
||||||
|
if (def && w == *def) return arc;
|
||||||
for (auto cstate : allAIStates)
|
for (auto cstate : allAIStates)
|
||||||
{
|
{
|
||||||
if (w == cstate)
|
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)
|
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))
|
if (arc.BeginObject(keyname))
|
||||||
{
|
{
|
||||||
arc("flags", w.flags, def->flags)
|
arc("flags", w.flags, def->flags)
|
||||||
|
("aistate", w.aiState, def->aiState)
|
||||||
("busy", w.busy, def->busy)
|
("busy", w.busy, def->busy)
|
||||||
("reference", w.reference, def->reference)
|
("reference", w.reference, def->reference)
|
||||||
("txid", w.txID, def->txID)
|
("txid", w.txID, def->txID)
|
||||||
|
|
|
@ -2300,7 +2300,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
|
||||||
("angold", w.angold)
|
("angold", w.angold)
|
||||||
("player_par", w.player_par)
|
("player_par", w.player_par)
|
||||||
("waterpal", w.nWaterPal)
|
("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();
|
.EndObject();
|
||||||
}
|
}
|
||||||
return arc;
|
return arc;
|
||||||
|
|
Loading…
Reference in a new issue