Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/control-stage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require "compound-entities"
---@param entity LuaEntity
---@param sprite string
---@param time_to_live integer
---@param blink_interval integer
---@param blink_interval integer?
py.draw_error_sprite = function(entity, sprite, time_to_live, blink_interval)
return rendering.draw_sprite {
sprite = sprite,
Expand Down
4 changes: 2 additions & 2 deletions lib/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ if settings.startup["pypp-no-globals"].value then
if not declaredNames[n] then
if py.stage == "control" then
-- temp
game.print(debug.traceback("attempt to write to undeclared global variable, please report it: " .. n, 2))
game.print(debug.traceback("attempt to write to undeclared global variable, please report it\nIf this is intended, add it to the globals list in pypp/lib/lib.lua" .. n, 2))
-- end temp
-- error("attempt to write to undeclared variable: " .. n, 2)
end
log(debug.traceback("INFO: creating a new global variable: " .. n, 2))
log(debug.traceback("INFO: creating a new global variable\nIf this is intended, add it to the globals list in pypp/lib/lib.lua" .. n, 2))
end
rawset(t, n, v) -- do the actual set
end,
Expand Down
3 changes: 2 additions & 1 deletion lib/metas/recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local table_insert = table.insert
---@field public add_ingredient_amount fun(self: data.RecipePrototype, ingredient_name: string, increase: number): data.RecipePrototype
---@field public set_result_amount fun(self: data.RecipePrototype, result_name: string, amount: number): data.RecipePrototype
---@field public set_ingredient_amount fun(self: data.RecipePrototype, ingredient_name: string, amount: number): data.RecipePrototype
---@field public get_main_product fun(self: data.RecipePrototype, allow_multi_product: bool?): LuaItemPrototype?|LuaFluidPrototype?
---@field public get_main_product fun(self: data.RecipePrototype, allow_multi_product: boolean?): LuaItemPrototype?|LuaFluidPrototype?
---@field public get_icons fun(self: data.RecipePrototype): data.IconData

local metas = {}
Expand Down Expand Up @@ -371,6 +371,7 @@ metas.get_main_product = function(self, allow_multi_product)
else -- or only result
_, result = next(self.results)
end
--[[@cast result data.ItemProductPrototype|data.ResearchProgressProductPrototype]]
-- Special modding funtimes case: invalid spec
if not (result.type == "research-progress" and result.research_item or result.name) then return end
if result.type ~= nil and (result.type ~= "item" and result.type ~= "fluid" and result.type ~= "research-progress") then return end
Expand Down
8 changes: 4 additions & 4 deletions lib/metas/technology.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---@class data.TechnologyPrototype
---@field public standardize fun(): data.TechnologyPrototype
---@field public add_prereq fun(prereq_technology_name: string): data.TechnologyPrototype
---@field public remove_prereq fun(prereq_technology_name: string): data.TechnologyPrototype
---@field public remove_pack fun(science_pack_name: string): data.TechnologyPrototype
---@field public add_pack fun(science_pack_name: string): data.TechnologyPrototype
---@field public add_prereq fun(self, prereq_technology_name: string): data.TechnologyPrototype
---@field public remove_prereq fun(self, prereq_technology_name: string): data.TechnologyPrototype
---@field public remove_pack fun(self, science_pack_name: string): data.TechnologyPrototype
---@field public add_pack fun(self, science_pack_name: string): data.TechnologyPrototype
---@field dependencies string[]

TECHNOLOGY = setmetatable(data.raw.technology, {
Expand Down