mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-22 13:09:41 +00:00
improved error handling in LocalScripts::add
This commit is contained in:
parent
baaf801521
commit
b6878c2e0c
1 changed files with 5 additions and 1 deletions
|
@ -93,7 +93,7 @@ std::pair<std::string, MWWorld::Ptr> MWWorld::LocalScripts::getNext()
|
||||||
|
|
||||||
void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||||
{
|
{
|
||||||
if (const ESM::Script *script = mStore.get<ESM::Script>().find (scriptName))
|
if (const ESM::Script *script = mStore.get<ESM::Script>().search (scriptName))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -108,6 +108,10 @@ void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||||
<< " because an exception has been thrown: " << exception.what() << std::endl;
|
<< " because an exception has been thrown: " << exception.what() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
std::cerr
|
||||||
|
<< "failed to add local script " << scriptName
|
||||||
|
<< " because the script does not exist." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWWorld::LocalScripts::addCell (CellStore *cell)
|
void MWWorld::LocalScripts::addCell (CellStore *cell)
|
||||||
|
|
Loading…
Reference in a new issue