mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 06:55:54 -04: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
@ -292,6 +292,12 @@ void RecordHelper::overrideEnchantmentRecord(const mwmp::EnchantmentRecord& reco
|
|||||||
|
|
||||||
if (record.baseId.empty())
|
if (record.baseId.empty())
|
||||||
{
|
{
|
||||||
|
if (recordData.mEffects.mList.empty())
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Ignoring new enchantment record with no effects");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
world->getModifiableStore().overrideRecord(recordData);
|
world->getModifiableStore().overrideRecord(recordData);
|
||||||
}
|
}
|
||||||
else if (doesEnchantmentRecordExist(record.baseId))
|
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(),
|
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");
|
hasBaseId ? record.baseId.c_str() : "empty");
|
||||||
|
|
||||||
RecordHelper::overrideSpellRecord(record.data);
|
RecordHelper::overrideSpellRecord(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (recordsType == mwmp::RECORD_TYPE::POTION)
|
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(),
|
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");
|
hasBaseId ? record.baseId.c_str() : "empty");
|
||||||
|
|
||||||
RecordHelper::overridePotionRecord(record.data);
|
RecordHelper::overridePotionRecord(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (recordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
|
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,
|
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");
|
hasBaseId ? record.baseId.c_str() : "empty");
|
||||||
|
|
||||||
RecordHelper::overrideEnchantmentRecord(record.data);
|
RecordHelper::overrideEnchantmentRecord(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (recordsType == mwmp::RECORD_TYPE::CREATURE)
|
else if (recordsType == mwmp::RECORD_TYPE::CREATURE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user