mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-04 00:26:45 +00:00 
			
		
		
		
	Use CellId::mWorldspace to find out whether objects are in the same worldspace
This commit is contained in:
		
							parent
							
								
									621e81fa7d
								
							
						
					
					
						commit
						d64be1c092
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,8 @@
 | 
			
		|||
 | 
			
		||||
#include <components/compiler/locals.hpp>
 | 
			
		||||
 | 
			
		||||
#include <components/esm/cellid.hpp>
 | 
			
		||||
 | 
			
		||||
#include "../mwworld/esmstore.hpp"
 | 
			
		||||
 | 
			
		||||
#include "../mwbase/environment.hpp"
 | 
			
		||||
| 
						 | 
				
			
			@ -435,8 +437,7 @@ namespace MWScript
 | 
			
		|||
        const MWWorld::Ptr ref = MWBase::Environment::get().getWorld()->getPtr(name, false);
 | 
			
		||||
 | 
			
		||||
        // If the objects are in different worldspaces, return a large value (just like vanilla)
 | 
			
		||||
        if (ref.getCell()->isExterior() ^ ref2.getCell()->isExterior()
 | 
			
		||||
            || (!ref.getCell()->isExterior() && !ref2.getCell()->isExterior() && ref.getCell() != ref2.getCell()))
 | 
			
		||||
        if (ref.getCell()->getCell()->getCellId().mWorldspace != ref2.getCell()->getCell()->getCellId().mWorldspace)
 | 
			
		||||
            return std::numeric_limits<float>().max();
 | 
			
		||||
 | 
			
		||||
        double diff[3];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue