1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-07 13:31:40 +02:00

minor fixes

This commit is contained in:
Gerkiz 2021-02-11 23:19:04 +01:00
parent 4abdfa0ede
commit 8f62d1ef9d
2 changed files with 27 additions and 3 deletions

View File

@ -1257,24 +1257,31 @@ function Public.reset_game()
local difficulties = {
[1] = {
name = 'Easy',
value = 0.75,
color = {r = 0.00, g = 0.25, b = 0.00},
print_color = {r = 0.00, g = 0.4, b = 0.00},
enabled = true
},
[2] = {
name = 'Normal',
value = 1,
color = {r = 0.00, g = 0.00, b = 0.25},
print_color = {r = 0.0, g = 0.0, b = 0.5}
},
[2] = {
[3] = {
name = 'Hard',
value = 1.5,
color = {r = 0.25, g = 0.00, b = 0.00},
print_color = {r = 0.4, g = 0.0, b = 0.00}
},
[3] = {
[4] = {
name = 'Nightmare',
value = 3,
color = {r = 0.35, g = 0.00, b = 0.00},
print_color = {r = 0.6, g = 0.0, b = 0.00}
},
[4] = {
[5] = {
name = 'Impossible',
value = 5,
color = {r = 0.45, g = 0.00, b = 0.00},

View File

@ -1755,6 +1755,10 @@ local function on_player_driving_changed_state(event)
end
local trusted = Session.get_trusted_table()
if #trusted == 0 then
return
end
local locomotive = WPT.get('locomotive')
if not locomotive or not locomotive.valid then
return
@ -1769,6 +1773,18 @@ local function on_player_driving_changed_state(event)
end
end
local function on_player_left_game(event)
local player = game.players[event.player_index]
if not player or not player.valid then
return
end
local trusted = Session.get_trusted_table()
if trusted[player.name] then
trusted[player.name] = nil
end
end
function Public.close_gui_player(frame)
if not frame then
return
@ -2413,5 +2429,6 @@ Event.add(defines.events.on_robot_mined_entity, on_player_and_robot_mined_entity
Event.add(defines.events.on_console_chat, on_console_chat)
Event.add(defines.events.on_player_changed_surface, on_player_changed_surface)
Event.add(defines.events.on_player_driving_changed_state, on_player_driving_changed_state)
Event.add(defines.events.on_player_left_game, on_player_left_game)
return Public