mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:45:34 +00:00
[Client] Allow use of baseId for more record types
Additionally, don't allow new enchantment records to be created if they have no effects, to avoid a crash.
This commit is contained in:
parent
a083439139
commit
aed4ca2fd2
2 changed files with 10 additions and 4 deletions
|
@ -292,7 +292,13 @@ void RecordHelper::overrideEnchantmentRecord(const mwmp::EnchantmentRecord& reco
|
|||
|
||||
if (record.baseId.empty())
|
||||
{
|
||||
world->getModifiableStore().overrideRecord(recordData);
|
||||
if (recordData.mEffects.mList.empty())
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Ignoring new enchantment record with no effects");
|
||||
return;
|
||||
}
|
||||
else
|
||||
world->getModifiableStore().overrideRecord(recordData);
|
||||
}
|
||||
else if (doesEnchantmentRecordExist(record.baseId))
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ void Worldstate::addRecords()
|
|||
LOG_APPEND(Log::LOG_ERROR, "- spell record %s, %s\n-- baseId is %s", record.data.mId.c_str(), record.data.mName.c_str(),
|
||||
hasBaseId ? record.baseId.c_str() : "empty");
|
||||
|
||||
RecordHelper::overrideSpellRecord(record.data);
|
||||
RecordHelper::overrideSpellRecord(record);
|
||||
}
|
||||
}
|
||||
else if (recordsType == mwmp::RECORD_TYPE::POTION)
|
||||
|
@ -59,7 +59,7 @@ void Worldstate::addRecords()
|
|||
LOG_APPEND(Log::LOG_ERROR, "- potion record %s, %s\n-- baseId is %s", record.data.mId.c_str(), record.data.mName.c_str(),
|
||||
hasBaseId ? record.baseId.c_str() : "empty");
|
||||
|
||||
RecordHelper::overridePotionRecord(record.data);
|
||||
RecordHelper::overridePotionRecord(record);
|
||||
}
|
||||
}
|
||||
else if (recordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
|
||||
|
@ -71,7 +71,7 @@ void Worldstate::addRecords()
|
|||
LOG_APPEND(Log::LOG_ERROR, "- enchantment record %s, %i\n-- baseId is %s", record.data.mId.c_str(), record.data.mData.mType,
|
||||
hasBaseId ? record.baseId.c_str() : "empty");
|
||||
|
||||
RecordHelper::overrideEnchantmentRecord(record.data);
|
||||
RecordHelper::overrideEnchantmentRecord(record);
|
||||
}
|
||||
}
|
||||
else if (recordsType == mwmp::RECORD_TYPE::CREATURE)
|
||||
|
|
Loading…
Reference in a new issue