1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-23 13:39:42 +00:00

Improve PositionCell warning message

This commit is contained in:
scrawl 2015-12-06 22:37:04 +01:00
parent 4b0ecaa0a0
commit 45a609bc54

View file

@ -300,14 +300,16 @@ namespace MWScript
} }
catch(std::exception&) catch(std::exception&)
{ {
// cell not found, move to exterior instead (vanilla PositionCell compatibility)
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID); const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID);
int cx,cy; int cx,cy;
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy); MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy); store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
if(!cell) if(!cell)
{ {
runtime.getContext().report ("unknown cell (" + cellID + ")"); std::string error = "PositionCell: unknown interior cell (" + cellID + "), moving to exterior instead";
std::cerr << "unknown cell (" << cellID << ")\n"; runtime.getContext().report (error);
std::cerr << error << std::endl;
} }
} }
if(store) if(store)