1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-07 07:15:32 +00:00

use correct mechanics manager

This commit is contained in:
Jiří Kuneš 2015-07-17 18:49:47 +02:00
parent 15107ca5cf
commit c019f8e23d
2 changed files with 5 additions and 2 deletions

View file

@ -6,6 +6,8 @@
#include <list> #include <list>
#include <stdint.h> #include <stdint.h>
#include "../mwworld/ptr.hpp"
namespace osg namespace osg
{ {
class Vec3f; class Vec3f;
@ -211,6 +213,8 @@ namespace MWBase
/// Has the player stolen this item from the given owner? /// Has the player stolen this item from the given owner?
virtual bool isItemStolenFrom(const std::string& itemid, const std::string& ownerid) = 0; virtual bool isItemStolenFrom(const std::string& itemid, const std::string& ownerid) = 0;
virtual bool isAllowedToUse (const MWWorld::Ptr& ptr, const MWWorld::CellRef& cellref, MWWorld::Ptr& victim) = 0;
}; };
} }

View file

@ -17,7 +17,6 @@
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"
#include "../mwmechanics/spellcasting.hpp" #include "../mwmechanics/spellcasting.hpp"
#include "../mwmechanics/mechanicsmanagerimp.hpp"
#include "mapwindow.hpp" #include "mapwindow.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"
@ -364,7 +363,7 @@ namespace MWGui
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWWorld::Ptr victim; MWWorld::Ptr victim;
MWMechanics::MechanicsManager* mm = new MWMechanics::MechanicsManager; MWBase::MechanicsManager* mm = MWBase::Environment::get().getMechanicsManager();
bool allowed = mm->isAllowedToUse(ptr, cellref, victim); // 0 - owned, 1 - not owned bool allowed = mm->isAllowedToUse(ptr, cellref, victim); // 0 - owned, 1 - not owned
wm->setCrosshairOwned(!allowed); wm->setCrosshairOwned(!allowed);