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

[Client] Use a template to combine RecordHelper override functions

This commit is contained in:
David Cernat 2019-10-15 07:21:48 +03:00
parent d113f81237
commit 17020fc13a
3 changed files with 9 additions and 175 deletions

View file

@ -165,7 +165,7 @@ void DedicatedPlayer::setBaseInfo()
}
else
{
RecordHelper::overrideNpcRecord(npc);
RecordHelper::overrideRecord(npc);
reloadPtr();
}
@ -208,7 +208,7 @@ void DedicatedPlayer::setShapeshift()
else
{
creature.mId = creatureRecordId;
RecordHelper::overrideCreatureRecord(creature);
RecordHelper::overrideRecord(creature);
}
LOG_APPEND(TimedLog::LOG_INFO, "- Creating reference for %s", creature.mId.c_str());
@ -223,7 +223,7 @@ void DedicatedPlayer::setShapeshift()
deleteReference();
}
RecordHelper::overrideNpcRecord(npc);
RecordHelper::overrideRecord(npc);
createReference(npc.mId);
reloadPtr();
}

View file

@ -1549,150 +1549,3 @@ void RecordHelper::overrideCellRecord(const mwmp::CellRecord& record)
world->changeToInteriorCell(recordData.mName, playerPos, true, true);
}
}
void RecordHelper::overrideCreatureRecord(const ESM::Creature& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideNpcRecord(const ESM::NPC& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideEnchantmentRecord(const ESM::Enchantment& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overridePotionRecord(const ESM::Potion& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideSpellRecord(const ESM::Spell& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideArmorRecord(const ESM::Armor& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideBookRecord(const ESM::Book& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideClothingRecord(const ESM::Clothing& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideMiscellaneousRecord(const ESM::Miscellaneous& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideWeaponRecord(const ESM::Weapon& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideContainerRecord(const ESM::Container& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideDoorRecord(const ESM::Door& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideActivatorRecord(const ESM::Activator& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideStaticRecord(const ESM::Static& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideIngredientRecord(const ESM::Ingredient& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideApparatusRecord(const ESM::Apparatus& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideLockpickRecord(const ESM::Lockpick& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideProbeRecord(const ESM::Probe& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideRepairRecord(const ESM::Repair& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideLightRecord(const ESM::Light& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}
void RecordHelper::overrideCellRecord(const ESM::Cell& record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getModifiableStore().overrideRecord(record);
}

View file

@ -68,32 +68,13 @@ namespace RecordHelper
void overrideLightRecord(const mwmp::LightRecord& record);
void overrideCellRecord(const mwmp::CellRecord& record);
void overrideCreatureRecord(const ESM::Creature& record);
void overrideNpcRecord(const ESM::NPC& record);
template<class RecordType>
void overrideRecord(const RecordType &record)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
void overrideEnchantmentRecord(const ESM::Enchantment& record);
void overridePotionRecord(const ESM::Potion& record);
void overrideSpellRecord(const ESM::Spell& record);
void overrideArmorRecord(const ESM::Armor& record);
void overrideBookRecord(const ESM::Book& record);
void overrideClothingRecord(const ESM::Clothing& record);
void overrideMiscellaneousRecord(const ESM::Miscellaneous& record);
void overrideWeaponRecord(const ESM::Weapon& record);
void overrideContainerRecord(const ESM::Container& record);
void overrideDoorRecord(const ESM::Door& record);
void overrideActivatorRecord(const ESM::Activator& record);
void overrideStaticRecord(const ESM::Static& record);
void overrideIngredientRecord(const ESM::Ingredient& record);
void overrideApparatusRecord(const ESM::Apparatus& record);
void overrideLockpickRecord(const ESM::Lockpick& record);
void overrideProbeRecord(const ESM::Probe& record);
void overrideRepairRecord(const ESM::Repair& record);
void overrideLightRecord(const ESM::Light& record);
void overrideCellRecord(const ESM::Cell& record);
world->getModifiableStore().overrideRecord(record);
}
}