1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Merge remote-tracking branch 'maqifrnswa/bug2407'

This commit is contained in:
Marc Zinnschlag 2015-03-03 11:26:25 +01:00
commit 3b8d709583

View file

@ -310,12 +310,13 @@ namespace MWScript
}
catch(std::exception&)
{
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID);
if(cell)
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID);
int cx,cy;
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
if(!cell)
{
int cx,cy;
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
std::cerr << "unknown cell (" << cellID << ")\n";
}
}
if(store)
@ -335,10 +336,6 @@ namespace MWScript
ptr.getClass().adjustPosition(ptr, false);
}
else
{
throw std::runtime_error (std::string("unknown cell (") + cellID + ")");
}
}
};
@ -426,11 +423,12 @@ namespace MWScript
catch(std::exception&)
{
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID);
if(cell)
int cx,cy;
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
if(!cell)
{
int cx,cy;
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
std::cerr << "unknown cell (" << cellID << ")\n";
}
}
if(store)
@ -446,10 +444,6 @@ namespace MWScript
MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
placed.getClass().adjustPosition(placed, true);
}
else
{
throw std::runtime_error ( std::string("unknown cell (") + cellID + ")");
}
}
};