mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Add joinable legacy code
This commit is contained in:
@@ -18,7 +18,7 @@ Event.add(defines.events.on_player_created, function(event)
|
||||
-- spawn items
|
||||
for item, callback in pairs(items) do
|
||||
if type(callback) == 'function' then
|
||||
local stats = player.force.item_production_statistics
|
||||
local stats = player.force.get_item_production_statistics(player.surface)
|
||||
local made = stats.get_input_count(item)
|
||||
local success, count = pcall(callback, made, stats.get_input_count, player)
|
||||
count = math.floor(count)
|
||||
|
||||
@@ -24,10 +24,10 @@ end)
|
||||
local speech_bubble_async =
|
||||
Async.register(function(data)
|
||||
local message =
|
||||
data.entity.surface.create_entity{
|
||||
data.ent.surface.create_entity{
|
||||
name = 'compi-speech-bubble',
|
||||
text = messages[data.name][data.msg_number],
|
||||
source = data.entity,
|
||||
source = data.ent,
|
||||
position = {0, 0},
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ end
|
||||
-- @tparam string location the location tag that is in the config file
|
||||
function Public.spawn_compilatron(surface, location)
|
||||
local position = locations[location]
|
||||
local pos = surface.find_non_colliding_position('compilatron', position, 1.5, 0.5)
|
||||
local compi = surface.create_entity {name='compilatron', position=pos, force=game.forces.neutral}
|
||||
local pos = surface.find_non_colliding_position('small-biter', position, 1.5, 0.5)
|
||||
local compi = surface.create_entity {name='small-biter', position=pos, force=game.forces.neutral}
|
||||
Public.add_compilatron(compi, location)
|
||||
end
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ local function spawn_area(surface, position)
|
||||
local fill_tile = surface.get_tile(position).name
|
||||
|
||||
-- Make sure a non water tile is used for each tile
|
||||
if surface.get_tile(position).collides_with('player-layer') then fill_tile = 'landfill' end
|
||||
if surface.get_tile(position).collides_with('player') then fill_tile = 'landfill' end
|
||||
if decon_tile == nil then decon_tile = fill_tile end
|
||||
|
||||
local tiles_to_make = {}
|
||||
@@ -156,7 +156,7 @@ local function spawn_area(surface, position)
|
||||
if dst < tr2 then
|
||||
-- If it is inside the decon radius always set the tile
|
||||
table.insert(tiles_to_make, {name=decon_tile, position=pos})
|
||||
elseif dst < fr2 and surface.get_tile(pos).collides_with('player-layer') then
|
||||
elseif dst < fr2 and surface.get_tile(pos).collides_with('player') then
|
||||
-- If it is inside the fill radius only set the tile if it is water
|
||||
table.insert(tiles_to_make, {name=fill_tile, position=pos})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user