1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 09:23:51 +00:00

initialise blank global records

This commit is contained in:
Marc Zinnschlag 2012-12-03 22:16:02 +01:00
parent 8e93bfa607
commit 5cd2fe00ab
3 changed files with 10 additions and 0 deletions

View file

@ -265,6 +265,7 @@ namespace CSMWorld
{ {
ESXRecordT record; ESXRecordT record;
record.mId = id; record.mId = id;
record.blank();
add (record); add (record);
} }
} }

View file

@ -44,6 +44,12 @@ void Global::save(ESMWriter &esm)
esm.writeHNT("FLTV", mValue); esm.writeHNT("FLTV", mValue);
} }
void Global::blank()
{
mValue = 0;
mType = VT_Float;
}
bool operator== (const Global& left, const Global& right) bool operator== (const Global& left, const Global& right)
{ {
return left.mId==right.mId && left.mValue==right.mValue && left.mType==right.mType; return left.mId==right.mId && left.mValue==right.mValue && left.mType==right.mType;

View file

@ -23,6 +23,9 @@ struct Global
void load(ESMReader &esm); void load(ESMReader &esm);
void save(ESMWriter &esm); void save(ESMWriter &esm);
void blank();
///< Set record to default state (does not touch the ID).
}; };
bool operator== (const Global& left, const Global& right); bool operator== (const Global& left, const Global& right);