mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 21:45:33 +00:00
if cell doesn't exist, PositionCell and PlaceItemCell warn std::err but still execute, bug #2407
This commit is contained in:
parent
64938b3796
commit
53213bf236
1 changed files with 11 additions and 17 deletions
|
@ -311,11 +311,12 @@ namespace MWScript
|
||||||
catch(std::exception&)
|
catch(std::exception&)
|
||||||
{
|
{
|
||||||
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID);
|
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;
|
std::cerr << "unknown cell (" << cellID << ")\n";
|
||||||
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
|
|
||||||
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(store)
|
if(store)
|
||||||
|
@ -335,10 +336,6 @@ namespace MWScript
|
||||||
|
|
||||||
ptr.getClass().adjustPosition(ptr, false);
|
ptr.getClass().adjustPosition(ptr, false);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
throw std::runtime_error (std::string("unknown cell (") + cellID + ")");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -426,11 +423,12 @@ namespace MWScript
|
||||||
catch(std::exception&)
|
catch(std::exception&)
|
||||||
{
|
{
|
||||||
const ESM::Cell* cell = MWBase::Environment::get().getWorld()->getExterior(cellID);
|
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;
|
std::cerr << "unknown cell (" << cellID << ")\n";
|
||||||
MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy);
|
|
||||||
store = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(store)
|
if(store)
|
||||||
|
@ -446,10 +444,6 @@ namespace MWScript
|
||||||
MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
|
MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
|
||||||
placed.getClass().adjustPosition(placed, true);
|
placed.getClass().adjustPosition(placed, true);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
throw std::runtime_error ( std::string("unknown cell (") + cellID + ")");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue