mirror of
				https://codeberg.org/tenplus1/mobs_redo.git
				synced 2025-10-25 22:05:25 +02:00 
			
		
		
		
	clean aliased mob staticdata
This commit is contained in:
		
							
								
								
									
										20
									
								
								api.lua
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								api.lua
									
									
									
									
									
								
							| @@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi") | |||||||
|  |  | ||||||
| mobs = { | mobs = { | ||||||
| 	mod = "redo", | 	mod = "redo", | ||||||
| 	version = "20221213", | 	version = "20221222", | ||||||
| 	intllib = S, | 	intllib = S, | ||||||
| 	invis = minetest.global_exists("invisibility") and invisibility or {} | 	invis = minetest.global_exists("invisibility") and invisibility or {} | ||||||
| } | } | ||||||
| @@ -4830,7 +4830,23 @@ function mobs:alias_mob(old_name, new_name) | |||||||
| 		end, | 		end, | ||||||
|  |  | ||||||
| 		get_staticdata = function(self) | 		get_staticdata = function(self) | ||||||
| 			return self |  | ||||||
|  | 			local tmp, t = {} | ||||||
|  |  | ||||||
|  | 			for _,stat in pairs(self) do | ||||||
|  |  | ||||||
|  | 				t = type(stat) | ||||||
|  |  | ||||||
|  | 				if  t ~= "function" | ||||||
|  | 				and t ~= "nil" | ||||||
|  | 				and t ~= "userdata" | ||||||
|  | 				and _ ~= "object" | ||||||
|  | 				and _ ~= "_cmi_components" then | ||||||
|  | 					tmp[_] = self[_] | ||||||
|  | 				end | ||||||
|  | 			end | ||||||
|  |  | ||||||
|  | 			return minetest.serialize(tmp) | ||||||
| 		end | 		end | ||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user