Recipe: Fix a bug
This commit is contained in:
		
							parent
							
								
									f8c4b94165
								
							
						
					
					
						commit
						acd86bfe2b
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -11,16 +11,15 @@ function Recipe:new(value)
 | 
				
			||||||
    if type(value) == "string" then
 | 
					    if type(value) == "string" then
 | 
				
			||||||
        name = value
 | 
					        name = value
 | 
				
			||||||
        recipe = data.raw.recipe[name]
 | 
					        recipe = data.raw.recipe[name]
 | 
				
			||||||
 | 
					        if not recipe then
 | 
				
			||||||
 | 
					            log("Recipe not found: " .. name)
 | 
				
			||||||
 | 
					            return nil
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    elseif type(value) == "table" then
 | 
					    elseif type(value) == "table" then
 | 
				
			||||||
        name = value.name
 | 
					        name = value.name
 | 
				
			||||||
        recipe = value
 | 
					        recipe = value
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if not recipe then
 | 
					 | 
				
			||||||
        log("Recipe not found: " .. name)
 | 
					 | 
				
			||||||
        return nil
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    local obj = {
 | 
					    local obj = {
 | 
				
			||||||
        prototype = recipe
 | 
					        prototype = recipe
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue