1
0
Fork 1
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:
Marc Zinnschlag 2015-05-27 19:45:26 +02:00
parent baaf801521
commit b6878c2e0c

View file

@ -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)