mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Return type as a sol::object instead of a table proxy
This commit is contained in:
		
							parent
							
								
									2e67c8b47f
								
							
						
					
					
						commit
						823dc6a896
					
				
					 1 changed files with 3 additions and 4 deletions
				
			
		|  | @ -330,10 +330,9 @@ namespace MWLua | |||
|                 return LuaUtil::Box{ bb.center(), bb._max - bb.center() }; | ||||
|             }; | ||||
| 
 | ||||
|             objectT["type"] | ||||
|                 = sol::readonly_property([types = getTypeToPackageTable(context.sol())](const ObjectT& o) mutable { | ||||
|                       return types[getLiveCellRefType(o.ptr().mRef)]; | ||||
|                   }); | ||||
|             objectT["type"] = sol::readonly_property( | ||||
|                 [types = getTypeToPackageTable(context.sol())]( | ||||
|                     const ObjectT& o) -> sol::object { return types[getLiveCellRefType(o.ptr().mRef)]; }); | ||||
| 
 | ||||
|             objectT["count"] = sol::readonly_property([](const ObjectT& o) { return o.ptr().getCellRef().getCount(); }); | ||||
|             objectT[sol::meta_function::equal_to] = [](const ObjectT& a, const ObjectT& b) { return a.id() == b.id(); }; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue