1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Update control.lua

This commit is contained in:
Valansch 2018-11-04 02:16:24 +01:00 committed by GitHub
parent 2c1d0bf077
commit 3ff389c9d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,24 +226,6 @@ end
global.cheated_items = {}
global.cheated_items_by_timestamp = {}
local Token = require 'utils.global_token'
local Task = require 'utils.Task'
local remove_token =
Token.register(
function(data)
local p = data.player
local stack = data.stack
local removed = p.remove_item(stack)
if removed > 0 then
stack.count = removed
p.surface.spill_item_stack(p.position, stack)
end
end
)
Event.add(
defines.events.on_player_crafted_item,
function(event)
@ -268,12 +250,6 @@ Event.add(
local count = user_item_record.count
local time = user_item_record['time'] or format_time(game.tick)
data[name] = {count = stack.count + count, time = time}
if _DEBUG then
return
end
Task.set_timeout_in_ticks(1, remove_token, {player = p, stack = stack})
end
)