mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:59:56 +00:00
Fix increment of dynamic id when player is inserted
This commit is contained in:
parent
6abb96250f
commit
cdcf1393fc
1 changed files with 3 additions and 3 deletions
|
@ -296,13 +296,13 @@ namespace MWWorld
|
||||||
template <>
|
template <>
|
||||||
inline const ESM::NPC *ESMStore::insert<ESM::NPC>(const ESM::NPC &npc)
|
inline const ESM::NPC *ESMStore::insert<ESM::NPC>(const ESM::NPC &npc)
|
||||||
{
|
{
|
||||||
const std::string id = "$dynamic" + std::to_string(mDynamicCount++);
|
|
||||||
|
|
||||||
if (Misc::StringUtils::ciEqual(npc.mId, "player"))
|
if (Misc::StringUtils::ciEqual(npc.mId, "player"))
|
||||||
{
|
{
|
||||||
return mNpcs.insert(npc);
|
return mNpcs.insert(npc);
|
||||||
}
|
}
|
||||||
else if (mNpcs.search(id) != nullptr)
|
|
||||||
|
const std::string id = "$dynamic" + std::to_string(mDynamicCount++);
|
||||||
|
if (mNpcs.search(id) != nullptr)
|
||||||
{
|
{
|
||||||
const std::string msg = "Try to override existing record '" + id + "'";
|
const std::string msg = "Try to override existing record '" + id + "'";
|
||||||
throw std::runtime_error(msg);
|
throw std::runtime_error(msg);
|
||||||
|
|
Loading…
Reference in a new issue