@@ -15,7 +15,6 @@ local get_overlapping_tiles = Geom2D.get_overlapping_tiles
1515
1616
1717function Landfill .compute_prototype_overrides ()
18- -- game.print("Landfill.compute_prototype_overrides")
1918 -- Some entities require special arguments when created. We skip those; they're unlikely to come up in blueprints
2019 -- anyways
2120 local type_blacklist = {
@@ -71,7 +70,7 @@ function Landfill.compute_prototype_overrides()
7170 end
7271 t [d ] = data
7372
74- log (" ... [" .. name .. " ][" .. d .. " ] = " .. serpent .line (t [d ]))
73+ -- log("... [" .. name .. "][" .. d .. "] = " .. serpent.line(t[d]))
7574 end
7675 e .destroy ()
7776 end
8988
9089function Landfill .on_load ()
9190 Landfill .prototype_overrides = global .prototype_overrides
92- for ent , dirs in pairs (Landfill .prototype_overrides ) do
93- for dir , rects in pairs (dirs ) do
94- for _ , rect in pairs (rects ) do
95- setmetatable (rect , Rect .__mt )
91+ if Landfill .prototype_overrides then
92+ for ent , dirs in pairs (Landfill .prototype_overrides ) do
93+ for dir , rects in pairs (dirs ) do
94+ for _ , rect in pairs (rects ) do
95+ setmetatable (rect , Rect .__mt )
96+ end
9697 end
9798 end
9899 end
@@ -162,7 +163,7 @@ function Landfill.landfill_action(player, event, action)
162163 y = (entity .position .y or 0 ) + offset
163164 dir = entity .direction or 0
164165
165- override = (overrides [name ] and overrides [name ][dir ]) or nil
166+ override = (overrides and overrides [name ] and overrides [name ][dir ]) or nil
166167
167168 if override then
168169 for _ , source in pairs (override ) do
0 commit comments