forked from cacklingfiend/lignumis
		
	Fix crash when there is a tree that has no minable property
This commit is contained in:
		
							parent
							
								
									415054ae2b
								
							
						
					
					
						commit
						81214f2a46
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -99,6 +99,7 @@ for _, tree in pairs(data.raw.tree) do
 | 
				
			||||||
        return result.name == "wood"
 | 
					        return result.name == "wood"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    local minable = tree.minable
 | 
					    local minable = tree.minable
 | 
				
			||||||
 | 
					    if not minable then goto continue end
 | 
				
			||||||
    local woodResults = minable.results and table.filter(minable.results, isWoodResult)
 | 
					    local woodResults = minable.results and table.filter(minable.results, isWoodResult)
 | 
				
			||||||
    local isRegularTree = (minable.result == "wood" and minable.count == 4) or (minable.results and #minable.results == 1 and #woodResults == 1 and woodResults[1].amount == 4)
 | 
					    local isRegularTree = (minable.result == "wood" and minable.count == 4) or (minable.results and #minable.results == 1 and #woodResults == 1 and woodResults[1].amount == 4)
 | 
				
			||||||
    if not isRegularTree then goto continue end
 | 
					    if not isRegularTree then goto continue end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue