From 408c5b8bd46214e685792aab4750d19688418776 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 18 Sep 2012 10:49:51 +0200 Subject: [PATCH] some cleanup --- .../mwscript/transformationextensions.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 4ce1c7cdfe..cd979e2ecb 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -1,6 +1,9 @@ #include +#include + #include +#include #include @@ -11,18 +14,13 @@ #include "../mwbase/environment.hpp" #include "../mwworld/class.hpp" +#include "../mwworld/player.hpp" +#include "../mwworld/manualref.hpp" #include "interpretercontext.hpp" #include "ref.hpp" #include "OgreSceneNode.h" - -#include "../mwworld/player.hpp" -#include -#include "../mwworld/manualref.hpp" - -#include "OgreMath.h" - namespace MWScript { namespace Transformation @@ -172,6 +170,8 @@ namespace MWScript { runtime.push(ptr.getRefData().getPosition().pos[2]); } + else + throw std::runtime_error ("invalid rotation axis: " + axis); } }; @@ -192,7 +192,6 @@ namespace MWScript float ax = ptr.getRefData().getPosition().pos[0]; float ay = ptr.getRefData().getPosition().pos[1]; float az = ptr.getRefData().getPosition().pos[2]; - if(axis == "x") { @@ -206,6 +205,8 @@ namespace MWScript { MWBase::Environment::get().getWorld()->moveObject(ptr,ax,ay,pos); } + else + throw std::runtime_error ("invalid axis: " + axis); } }; @@ -233,6 +234,8 @@ namespace MWScript { runtime.push(ptr.getCellRef().pos.pos[2]); } + else + throw std::runtime_error ("invalid axis: " + axis); } }; @@ -331,8 +334,6 @@ namespace MWScript virtual void execute (Interpreter::Runtime& runtime) { - //MWWorld::Ptr ptr = R()(runtime); - std::string itemID = runtime.getStringLiteral (runtime[0].mInteger); runtime.pop(); std::string cellID = runtime.getStringLiteral (runtime[0].mInteger); @@ -402,10 +403,9 @@ namespace MWScript Interpreter::Type_Float zRot = runtime[0].mFloat; runtime.pop(); - MWWorld::CellStore* store = 0; int cx,cy; MWBase::Environment::get().getWorld()->positionToIndex(x,y,cx,cy); - store = MWBase::Environment::get().getWorld()->getExterior(cx,cy); + MWWorld::CellStore* store = MWBase::Environment::get().getWorld()->getExterior(cx,cy); if(store) { ESM::Position pos;