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

fixed collision toggling bug

This commit is contained in:
Marc Zinnschlag 2011-10-29 09:50:11 +02:00
parent c3a492bf74
commit 33ecd8b66c

View file

@ -1,3 +1,5 @@
#include <stdexcept>
#include "physicssystem.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/world.hpp" // FIXME
@ -153,8 +155,11 @@ namespace MWWorld
bool PhysicsSystem::toggleCollisionMode()
{
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = mEngine->PhysicActorMap.begin(); it != mEngine->PhysicActorMap.end();it++)
{
if (it->first=="player")
{
OEngine::Physic::PhysicActor* act = it->second;
bool cmode = act->getCollisionMode();
if(cmode)
{
@ -173,9 +178,9 @@ namespace MWWorld
return true;
}
}
}
return false; // This should never happen, but it shall not bother us now, since
// this part of the code needs a rewrite anyway.
throw std::logic_error ("can't find player");
}
}