mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	use correct mechanics manager
This commit is contained in:
		
							parent
							
								
									15107ca5cf
								
							
						
					
					
						commit
						c019f8e23d
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -6,6 +6,8 @@
 | 
			
		|||
#include <list>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
#include "../mwworld/ptr.hpp"
 | 
			
		||||
 | 
			
		||||
namespace osg
 | 
			
		||||
{
 | 
			
		||||
    class Vec3f;
 | 
			
		||||
| 
						 | 
				
			
			@ -211,6 +213,8 @@ namespace MWBase
 | 
			
		|||
 | 
			
		||||
            /// Has the player stolen this item from the given owner?
 | 
			
		||||
            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;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,6 @@
 | 
			
		|||
#include "../mwworld/class.hpp"
 | 
			
		||||
#include "../mwworld/esmstore.hpp"
 | 
			
		||||
#include "../mwmechanics/spellcasting.hpp"
 | 
			
		||||
#include "../mwmechanics/mechanicsmanagerimp.hpp"
 | 
			
		||||
 | 
			
		||||
#include "mapwindow.hpp"
 | 
			
		||||
#include "inventorywindow.hpp"
 | 
			
		||||
| 
						 | 
				
			
			@ -364,7 +363,7 @@ namespace MWGui
 | 
			
		|||
                MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
 | 
			
		||||
                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
 | 
			
		||||
 | 
			
		||||
                wm->setCrosshairOwned(!allowed);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue