mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 21:45:33 +00:00
Warn about adding a local script twice (Bug #2806)
This commit is contained in:
parent
aa9905b0eb
commit
187d2bccda
1 changed files with 8 additions and 0 deletions
|
@ -110,6 +110,14 @@ void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||||
{
|
{
|
||||||
ptr.getRefData().setLocals (*script);
|
ptr.getRefData().setLocals (*script);
|
||||||
|
|
||||||
|
for (std::list<std::pair<std::string, Ptr> >::iterator iter = mScripts.begin(); iter!=mScripts.end(); ++iter)
|
||||||
|
if (iter->second==ptr)
|
||||||
|
{
|
||||||
|
std::cout << "warning, tried to add local script twice for " << ptr.getCellRef().getRefId() << std::endl;
|
||||||
|
remove(ptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
mScripts.push_back (std::make_pair (scriptName, ptr));
|
mScripts.push_back (std::make_pair (scriptName, ptr));
|
||||||
}
|
}
|
||||||
catch (const std::exception& exception)
|
catch (const std::exception& exception)
|
||||||
|
|
Loading…
Reference in a new issue