1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 05:45:33 +00:00

[Server] Reorder record types in RecordsDynamic script functions

They are now consistent with the ordering from 42b002e8db
This commit is contained in:
David Cernat 2019-11-30 19:12:57 +02:00
parent 42b002e8db
commit 397cdf400b

View file

@ -15,26 +15,26 @@ using namespace mwmp;
SpellRecord tempSpell; SpellRecord tempSpell;
PotionRecord tempPotion; PotionRecord tempPotion;
EnchantmentRecord tempEnchantment; EnchantmentRecord tempEnchantment;
CreatureRecord tempCreature;
NpcRecord tempNpc;
ArmorRecord tempArmor; ArmorRecord tempArmor;
BookRecord tempBook; BookRecord tempBook;
ClothingRecord tempClothing; ClothingRecord tempClothing;
MiscellaneousRecord tempMiscellaneous; MiscellaneousRecord tempMiscellaneous;
WeaponRecord tempWeapon; WeaponRecord tempWeapon;
ContainerRecord tempContainer;
DoorRecord tempDoor;
ActivatorRecord tempActivator; ActivatorRecord tempActivator;
StaticRecord tempStatic;
IngredientRecord tempIngredient;
ApparatusRecord tempApparatus; ApparatusRecord tempApparatus;
BodyPartRecord tempBodyPart;
CellRecord tempCell;
ContainerRecord tempContainer;
CreatureRecord tempCreature;
DoorRecord tempDoor;
IngredientRecord tempIngredient;
LightRecord tempLight;
LockpickRecord tempLockpick; LockpickRecord tempLockpick;
NpcRecord tempNpc;
ProbeRecord tempProbe; ProbeRecord tempProbe;
RepairRecord tempRepair; RepairRecord tempRepair;
LightRecord tempLight;
CellRecord tempCell;
ScriptRecord tempScript; ScriptRecord tempScript;
BodyPartRecord tempBodyPart; StaticRecord tempStatic;
BaseOverrides tempOverrides; BaseOverrides tempOverrides;
@ -64,26 +64,26 @@ void RecordsDynamicFunctions::ClearRecords() noexcept
WorldstateFunctions::writeWorldstate.spellRecords.clear(); WorldstateFunctions::writeWorldstate.spellRecords.clear();
WorldstateFunctions::writeWorldstate.potionRecords.clear(); WorldstateFunctions::writeWorldstate.potionRecords.clear();
WorldstateFunctions::writeWorldstate.enchantmentRecords.clear(); WorldstateFunctions::writeWorldstate.enchantmentRecords.clear();
WorldstateFunctions::writeWorldstate.creatureRecords.clear();
WorldstateFunctions::writeWorldstate.npcRecords.clear();
WorldstateFunctions::writeWorldstate.armorRecords.clear(); WorldstateFunctions::writeWorldstate.armorRecords.clear();
WorldstateFunctions::writeWorldstate.bookRecords.clear(); WorldstateFunctions::writeWorldstate.bookRecords.clear();
WorldstateFunctions::writeWorldstate.clothingRecords.clear(); WorldstateFunctions::writeWorldstate.clothingRecords.clear();
WorldstateFunctions::writeWorldstate.miscellaneousRecords.clear(); WorldstateFunctions::writeWorldstate.miscellaneousRecords.clear();
WorldstateFunctions::writeWorldstate.weaponRecords.clear(); WorldstateFunctions::writeWorldstate.weaponRecords.clear();
WorldstateFunctions::writeWorldstate.containerRecords.clear();
WorldstateFunctions::writeWorldstate.doorRecords.clear();
WorldstateFunctions::writeWorldstate.activatorRecords.clear(); WorldstateFunctions::writeWorldstate.activatorRecords.clear();
WorldstateFunctions::writeWorldstate.staticRecords.clear();
WorldstateFunctions::writeWorldstate.ingredientRecords.clear();
WorldstateFunctions::writeWorldstate.apparatusRecords.clear(); WorldstateFunctions::writeWorldstate.apparatusRecords.clear();
WorldstateFunctions::writeWorldstate.bodyPartRecords.clear();
WorldstateFunctions::writeWorldstate.cellRecords.clear();
WorldstateFunctions::writeWorldstate.containerRecords.clear();
WorldstateFunctions::writeWorldstate.creatureRecords.clear();
WorldstateFunctions::writeWorldstate.doorRecords.clear();
WorldstateFunctions::writeWorldstate.ingredientRecords.clear();
WorldstateFunctions::writeWorldstate.lightRecords.clear();
WorldstateFunctions::writeWorldstate.lockpickRecords.clear(); WorldstateFunctions::writeWorldstate.lockpickRecords.clear();
WorldstateFunctions::writeWorldstate.npcRecords.clear();
WorldstateFunctions::writeWorldstate.probeRecords.clear(); WorldstateFunctions::writeWorldstate.probeRecords.clear();
WorldstateFunctions::writeWorldstate.repairRecords.clear(); WorldstateFunctions::writeWorldstate.repairRecords.clear();
WorldstateFunctions::writeWorldstate.lightRecords.clear();
WorldstateFunctions::writeWorldstate.cellRecords.clear();
WorldstateFunctions::writeWorldstate.scriptRecords.clear(); WorldstateFunctions::writeWorldstate.scriptRecords.clear();
WorldstateFunctions::writeWorldstate.bodyPartRecords.clear(); WorldstateFunctions::writeWorldstate.staticRecords.clear();
} }
unsigned short RecordsDynamicFunctions::GetRecordType() noexcept unsigned short RecordsDynamicFunctions::GetRecordType() noexcept
@ -350,10 +350,6 @@ void RecordsDynamicFunctions::SetRecordId(const char* id) noexcept
tempPotion.data.mId = id; tempPotion.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::ENCHANTMENT) else if (writeRecordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
tempEnchantment.data.mId = id; tempEnchantment.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::ARMOR) else if (writeRecordsType == mwmp::RECORD_TYPE::ARMOR)
tempArmor.data.mId = id; tempArmor.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::BOOK) else if (writeRecordsType == mwmp::RECORD_TYPE::BOOK)
@ -364,30 +360,34 @@ void RecordsDynamicFunctions::SetRecordId(const char* id) noexcept
tempMiscellaneous.data.mId = id; tempMiscellaneous.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mId = id; tempWeapon.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR) else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.data.mId = id; tempActivator.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
tempStatic.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mId = id; tempApparatus.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempBodyPart.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mId = id; tempLockpick.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mId = id; tempProbe.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mId = id; tempRepair.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::SCRIPT) else if (writeRecordsType == mwmp::RECORD_TYPE::SCRIPT)
tempScript.data.mId = id; tempScript.data.mId = id;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART) else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
tempBodyPart.data.mId = id; tempStatic.data.mId = id;
else else
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set id for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set id for record type %i which lacks that property", writeRecordsType);
} }
@ -416,32 +416,32 @@ void RecordsDynamicFunctions::SetRecordBaseId(const char* baseId) noexcept
tempMiscellaneous.baseId = baseId; tempMiscellaneous.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.baseId = baseId; tempWeapon.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempBodyPart.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::CELL)
tempCell.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER) else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.baseId = baseId; tempContainer.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR) else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.baseId = baseId; tempDoor.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
tempStatic.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT) else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.baseId = baseId; tempIngredient.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempApparatus.baseId = baseId; tempLight.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.baseId = baseId; tempLockpick.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.baseId = baseId; tempProbe.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.baseId = baseId; tempRepair.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::CELL)
tempCell.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::SCRIPT) else if (writeRecordsType == mwmp::RECORD_TYPE::SCRIPT)
tempScript.baseId = baseId; tempScript.baseId = baseId;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART) else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
tempBodyPart.baseId = baseId; tempStatic.baseId = baseId;
else else
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set baseId for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set baseId for record type %i which lacks that property", writeRecordsType);
} }
@ -509,26 +509,26 @@ void RecordsDynamicFunctions::SetRecordName(const char* name) noexcept
tempMiscellaneous.data.mName = name; tempMiscellaneous.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mName = name; tempWeapon.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::CELL)
tempCell.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER) else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mName = name; tempContainer.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR) else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.data.mName = name; tempDoor.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT) else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mName = name; tempIngredient.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempApparatus.data.mName = name; tempLight.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mName = name; tempLockpick.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mName = name; tempProbe.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mName = name; tempRepair.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mName = name;
else if (writeRecordsType == mwmp::RECORD_TYPE::CELL)
tempCell.data.mName = name;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set name for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set name for record type %i which lacks that property", writeRecordsType);
@ -558,28 +558,28 @@ void RecordsDynamicFunctions::SetRecordModel(const char* model) noexcept
tempMiscellaneous.data.mModel = model; tempMiscellaneous.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mModel = model; tempWeapon.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempBodyPart.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER) else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mModel = model; tempContainer.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR) else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.data.mModel = model; tempDoor.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
tempStatic.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT) else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mModel = model; tempIngredient.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempApparatus.data.mModel = model; tempLight.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mModel = model; tempLockpick.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mModel = model; tempProbe.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mModel = model; tempRepair.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT) else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
tempLight.data.mModel = model; tempStatic.data.mModel = model;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempBodyPart.data.mModel = model;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set model for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set model for record type %i which lacks that property", writeRecordsType);
@ -605,18 +605,18 @@ void RecordsDynamicFunctions::SetRecordIcon(const char* icon) noexcept
tempMiscellaneous.data.mIcon = icon; tempMiscellaneous.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mIcon = icon; tempWeapon.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mIcon = icon; tempApparatus.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mIcon = icon; tempLockpick.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mIcon = icon; tempProbe.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mIcon = icon; tempRepair.data.mIcon = icon;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mIcon = icon;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set icon for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set icon for record type %i which lacks that property", writeRecordsType);
@ -632,10 +632,6 @@ void RecordsDynamicFunctions::SetRecordScript(const char* script) noexcept
if (writeRecordsType == mwmp::RECORD_TYPE::POTION) if (writeRecordsType == mwmp::RECORD_TYPE::POTION)
tempPotion.data.mScript = script; tempPotion.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::ARMOR) else if (writeRecordsType == mwmp::RECORD_TYPE::ARMOR)
tempArmor.data.mScript = script; tempArmor.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::BOOK) else if (writeRecordsType == mwmp::RECORD_TYPE::BOOK)
@ -646,24 +642,28 @@ void RecordsDynamicFunctions::SetRecordScript(const char* script) noexcept
tempMiscellaneous.data.mScript = script; tempMiscellaneous.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mScript = script; tempWeapon.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR) else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
tempActivator.data.mScript = script; tempActivator.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mScript = script; tempApparatus.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
tempDoor.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mScript = script; tempLockpick.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mScript = script; tempProbe.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mScript = script; tempRepair.data.mScript = script;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mScript = script;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set script for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set script for record type %i which lacks that property", writeRecordsType);
@ -783,18 +783,18 @@ void RecordsDynamicFunctions::SetRecordFlags(int flags) noexcept
if (writeRecordsType == mwmp::RECORD_TYPE::SPELL) if (writeRecordsType == mwmp::RECORD_TYPE::SPELL)
tempSpell.data.mData.mFlags = flags; tempSpell.data.mData.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.data.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mData.mFlags = flags; tempWeapon.data.mData.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mData.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART) else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempBodyPart.data.mData.mFlags = flags; tempBodyPart.data.mData.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.data.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mData.mFlags = flags;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mFlags = flags;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set flags for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set flags for record type %i which lacks that property", writeRecordsType);
@ -820,18 +820,18 @@ void RecordsDynamicFunctions::SetRecordValue(int value) noexcept
tempMiscellaneous.data.mData.mValue = value; tempMiscellaneous.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mData.mValue = value; tempWeapon.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mData.mValue = value; tempApparatus.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mData.mValue = value; tempLockpick.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mData.mValue = value; tempProbe.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mData.mValue = value; tempRepair.data.mData.mValue = value;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mData.mValue = value;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set value for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set value for record type %i which lacks that property", writeRecordsType);
@ -857,20 +857,20 @@ void RecordsDynamicFunctions::SetRecordWeight(double weight) noexcept
tempMiscellaneous.data.mData.mWeight = weight; tempMiscellaneous.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON) else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
tempWeapon.data.mData.mWeight = weight; tempWeapon.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
tempApparatus.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER) else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.data.mWeight = weight; tempContainer.data.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT) else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
tempIngredient.data.mData.mWeight = weight; tempIngredient.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempApparatus.data.mData.mWeight = weight; tempLight.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
tempLockpick.data.mData.mWeight = weight; tempLockpick.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
tempProbe.data.mData.mWeight = weight; tempProbe.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR) else if (writeRecordsType == mwmp::RECORD_TYPE::REPAIR)
tempRepair.data.mData.mWeight = weight; tempRepair.data.mData.mWeight = weight;
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
tempLight.data.mData.mWeight = weight;
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set weight for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set weight for record type %i which lacks that property", writeRecordsType);
@ -1196,10 +1196,10 @@ void RecordsDynamicFunctions::SetRecordRace(const char* race) noexcept
{ {
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType; unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
if (writeRecordsType == mwmp::RECORD_TYPE::NPC) if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempNpc.data.mRace = race;
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
tempBodyPart.data.mRace = race; tempBodyPart.data.mRace = race;
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.data.mRace = race;
else else
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set race for record type %i which lacks that property", writeRecordsType); LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set race for record type %i which lacks that property", writeRecordsType);
@ -1588,18 +1588,6 @@ void RecordsDynamicFunctions::AddRecord() noexcept
WorldstateFunctions::writeWorldstate.enchantmentRecords.push_back(tempEnchantment); WorldstateFunctions::writeWorldstate.enchantmentRecords.push_back(tempEnchantment);
tempEnchantment = {}; tempEnchantment = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
{
tempCreature.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.creatureRecords.push_back(tempCreature);
tempCreature = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
{
tempNpc.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.npcRecords.push_back(tempNpc);
tempNpc = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::ARMOR) else if (writeRecordsType == mwmp::RECORD_TYPE::ARMOR)
{ {
tempArmor.baseOverrides = tempOverrides; tempArmor.baseOverrides = tempOverrides;
@ -1630,48 +1618,72 @@ void RecordsDynamicFunctions::AddRecord() noexcept
WorldstateFunctions::writeWorldstate.weaponRecords.push_back(tempWeapon); WorldstateFunctions::writeWorldstate.weaponRecords.push_back(tempWeapon);
tempWeapon = {}; tempWeapon = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
{
tempContainer.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.containerRecords.push_back(tempContainer);
tempContainer = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
{
tempDoor.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.doorRecords.push_back(tempDoor);
tempDoor = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR) else if (writeRecordsType == mwmp::RECORD_TYPE::ACTIVATOR)
{ {
tempActivator.baseOverrides = tempOverrides; tempActivator.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.activatorRecords.push_back(tempActivator); WorldstateFunctions::writeWorldstate.activatorRecords.push_back(tempActivator);
tempActivator = {}; tempActivator = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
{
tempStatic.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.staticRecords.push_back(tempStatic);
tempStatic = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
{
tempIngredient.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.ingredientRecords.push_back(tempIngredient);
tempIngredient = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS) else if (writeRecordsType == mwmp::RECORD_TYPE::APPARATUS)
{ {
tempApparatus.baseOverrides = tempOverrides; tempApparatus.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.apparatusRecords.push_back(tempApparatus); WorldstateFunctions::writeWorldstate.apparatusRecords.push_back(tempApparatus);
tempApparatus = {}; tempApparatus = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
{
tempBodyPart.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.bodyPartRecords.push_back(tempBodyPart);
tempBodyPart = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CELL)
{
tempCell.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.cellRecords.push_back(tempCell);
tempCell = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
{
tempContainer.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.containerRecords.push_back(tempContainer);
tempContainer = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
{
tempCreature.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.creatureRecords.push_back(tempCreature);
tempCreature = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::DOOR)
{
tempDoor.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.doorRecords.push_back(tempDoor);
tempDoor = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::INGREDIENT)
{
tempIngredient.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.ingredientRecords.push_back(tempIngredient);
tempIngredient = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
{
tempLight.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.lightRecords.push_back(tempLight);
tempLight = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK) else if (writeRecordsType == mwmp::RECORD_TYPE::LOCKPICK)
{ {
tempLockpick.baseOverrides = tempOverrides; tempLockpick.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.lockpickRecords.push_back(tempLockpick); WorldstateFunctions::writeWorldstate.lockpickRecords.push_back(tempLockpick);
tempLockpick = {}; tempLockpick = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
{
tempNpc.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.npcRecords.push_back(tempNpc);
tempNpc = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE) else if (writeRecordsType == mwmp::RECORD_TYPE::PROBE)
{ {
tempProbe.baseOverrides = tempOverrides; tempProbe.baseOverrides = tempOverrides;
@ -1684,29 +1696,17 @@ void RecordsDynamicFunctions::AddRecord() noexcept
WorldstateFunctions::writeWorldstate.repairRecords.push_back(tempRepair); WorldstateFunctions::writeWorldstate.repairRecords.push_back(tempRepair);
tempRepair = {}; tempRepair = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::LIGHT)
{
tempLight.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.lightRecords.push_back(tempLight);
tempLight = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CELL)
{
tempCell.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.cellRecords.push_back(tempCell);
tempCell = {};
}
else if (writeRecordsType == mwmp::RECORD_TYPE::SCRIPT) else if (writeRecordsType == mwmp::RECORD_TYPE::SCRIPT)
{ {
tempScript.baseOverrides = tempOverrides; tempScript.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.scriptRecords.push_back(tempScript); WorldstateFunctions::writeWorldstate.scriptRecords.push_back(tempScript);
tempScript = {}; tempScript = {};
} }
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART) else if (writeRecordsType == mwmp::RECORD_TYPE::STATIC)
{ {
tempBodyPart.baseOverrides = tempOverrides; tempStatic.baseOverrides = tempOverrides;
WorldstateFunctions::writeWorldstate.bodyPartRecords.push_back(tempBodyPart); WorldstateFunctions::writeWorldstate.staticRecords.push_back(tempStatic);
tempBodyPart = {}; tempStatic = {};
} }
effectCount = 0; effectCount = 0;
@ -1762,12 +1762,12 @@ void RecordsDynamicFunctions::AddRecordInventoryItem() noexcept
{ {
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType; unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE) if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.inventory.push_back(tempInventoryItem);
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
tempCreature.inventory.push_back(tempInventoryItem); tempCreature.inventory.push_back(tempInventoryItem);
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC) else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
tempNpc.inventory.push_back(tempInventoryItem); tempNpc.inventory.push_back(tempInventoryItem);
else if (writeRecordsType == mwmp::RECORD_TYPE::CONTAINER)
tempContainer.inventory.push_back(tempInventoryItem);
tempOverrides.hasInventory = true; tempOverrides.hasInventory = true;
tempInventoryItem = {}; tempInventoryItem = {};