1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 11:49:56 +00:00

Merge remote-tracking branch 'zini/master' into animation2

Conflicts:
	apps/openmw/mwworld/worldimp.cpp
This commit is contained in:
Chris Robinson 2013-02-05 03:26:46 -08:00
commit 4bd1e63ac1

View file

@ -688,15 +688,15 @@ namespace MWWorld
void World::moveObject(const Ptr &ptr, CellStore &newCell, float x, float y, float z) void World::moveObject(const Ptr &ptr, CellStore &newCell, float x, float y, float z)
{ {
ESM::Position &pos = ptr.getRefData().getPosition(); ESM::Position &pos = ptr.getRefData().getPosition();
pos.pos[0] = x, pos.pos[1] = y, pos.pos[2] = z; pos.pos[0] = x;
pos.pos[1] = y;
pos.pos[2] = z;
Ogre::Vector3 vec(x, y, z); Ogre::Vector3 vec(x, y, z);
CellStore *currCell = ptr.getCell(); CellStore *currCell = ptr.getCell();
bool isPlayer = ptr == mPlayer->getPlayer(); bool isPlayer = ptr == mPlayer->getPlayer();
bool haveToMove = mWorldScene->isCellActive(*currCell) || isPlayer; bool haveToMove = mWorldScene->isCellActive(*currCell) || isPlayer;
removeContainerScripts(ptr);
if (*currCell != newCell) if (*currCell != newCell)
{ {
if (isPlayer) if (isPlayer)
@ -719,6 +719,7 @@ namespace MWWorld
MWWorld::Class::get(ptr).copyToCell(ptr, newCell); MWWorld::Class::get(ptr).copyToCell(ptr, newCell);
mWorldScene->removeObjectFromScene(ptr); mWorldScene->removeObjectFromScene(ptr);
mLocalScripts.remove(ptr); mLocalScripts.remove(ptr);
removeContainerScripts (ptr);
haveToMove = false; haveToMove = false;
} }
else else
@ -726,17 +727,18 @@ namespace MWWorld
MWWorld::Ptr copy = MWWorld::Ptr copy =
MWWorld::Class::get(ptr).copyToCell(ptr, newCell); MWWorld::Class::get(ptr).copyToCell(ptr, newCell);
addContainerScripts(copy, &newCell);
mRendering->moveObjectToCell(copy, vec, currCell); mRendering->moveObjectToCell(copy, vec, currCell);
MWBase::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager(); MWBase::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager();
mechMgr->updateCell(copy); mechMgr->updateCell(copy);
std::string script = MWWorld::Class::get(ptr).getScript(ptr); std::string script =
if(!script.empty()) MWWorld::Class::get(ptr).getScript(ptr);
if (!script.empty())
{ {
mLocalScripts.remove(ptr); mLocalScripts.remove(ptr);
removeContainerScripts (ptr);
mLocalScripts.add(script, copy); mLocalScripts.add(script, copy);
addContainerScripts (copy, &newCell);
} }
} }
ptr.getRefData().setCount(0); ptr.getRefData().setCount(0);