1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00
This commit is contained in:
Gerkiz
2020-08-12 18:05:57 +02:00
parent eac77097f1
commit 9f0db44cc1
5 changed files with 18 additions and 10 deletions
+2 -2
View File
@@ -925,8 +925,8 @@ local on_player_or_robot_built_tile = function(event)
if old_tile.name == 'hazard-concrete-right' then
surface.set_tiles({{name = 'hazard-concrete-right', position = v.position}}, true)
end
if old_tile.name == 'tutorial-grid' then
surface.set_tiles({{name = 'tutorial-grid', position = v.position}}, true)
if old_tile.name == 'lab-dark-2' then
surface.set_tiles({{name = 'lab-dark-2', position = v.position}}, true)
end
end
end
+13 -3
View File
@@ -776,17 +776,25 @@ function Public.infinity_scrap(ic, event, recreate)
if not entity or not entity.valid then
return
end
local player = game.players[event.player_index]
local player
if event.player_index then
player = game.players[event.player_index]
else
if event.cause and event.cause.name == 'character' then
local cause = event.cause
player = cause.player
end
end
if not validate_player(player) then
return
end
event.buffer.clear()
if not is_owner_on_car_surface(ic, player) then
if get_player_surface(ic, player) then
entity.surface.create_entity({name = 'sand-rock-big', position = entity.position})
player.print('This is not your rock to mine!', Color.warning)
event.buffer.clear()
return
end
end
@@ -832,8 +840,10 @@ function Public.infinity_scrap(ic, event, recreate)
if entity.name ~= 'sand-rock-big' then
return
end
if get_player_surface(ic, player) then
if entity.position.x == 0 and entity.position.y == 20 or entity.position.y == 40 then
event.buffer.clear()
entity.surface.create_entity({name = 'sand-rock-big', position = entity.position})
player.insert({name = name, count = count})
if random(1, 4) == 1 then
+1 -1
View File
@@ -21,7 +21,7 @@ local function on_entity_died(event)
end
if entity.name == 'sand-rock-big' then
Functions.infinity_scrap(ic, entity, true)
Functions.infinity_scrap(ic, event, true)
end
end
+1 -2
View File
@@ -621,8 +621,6 @@ function Public.locomotive_mining(icw, event)
return
end
event.buffer.clear()
local items = {
'iron-plate',
'iron-gear-wheel',
@@ -645,6 +643,7 @@ function Public.locomotive_mining(icw, event)
if entity.type ~= 'simple-entity' then
return
end
event.buffer.clear()
player.insert({name = name, count = count})
if random(1, 4) == 1 then
player.insert({name = 'coin', count = 1})
+1 -2
View File
@@ -211,7 +211,7 @@ end
function Public.on_player_mined_entity(event)
local entity = event.entity
if not entity.valid then
if not entity or not entity.valid then
return
end
@@ -224,7 +224,6 @@ function Public.on_player_mined_entity(event)
if valid_rocks[entity.name] or valid_trees[entity.name] then
event.buffer.clear()
local data = {
this = this,
entity = entity,