1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-30 23:17:53 +02:00

more bug fixes

This commit is contained in:
Gerkiz 2021-01-12 21:53:19 +01:00
parent 68b99f39f4
commit 01c33a4fe0
7 changed files with 24 additions and 9 deletions

View File

@ -317,8 +317,8 @@ local function kick_players_from_surface(ic, car)
e.player.teleport(main_surface.find_non_colliding_position('character', game.forces.player.get_spawn_position(main_surface), 3, 0, 5), main_surface)
end
end
return log_err('Car entity was not valid.')
end
return log_err('Car entity was not valid.')
end
for _, e in pairs(car.surface.find_entities_filtered({area = car.area})) do

View File

@ -18,6 +18,7 @@ local function on_entity_died(event)
local ic = IC.get()
if entity.type == 'car' or entity.name == 'spidertron' then
Minimap.kill_minimap(game.players[event.player_index])
Functions.kill_car(ic, entity)
end
end
@ -30,9 +31,8 @@ local function on_player_mined_entity(event)
local ic = IC.get()
Minimap.kill_minimap(game.players[event.player_index])
if entity.type == 'car' or entity.name == 'spidertron' then
Minimap.kill_minimap(game.players[event.player_index])
Functions.save_car(ic, event)
end
end

View File

@ -175,6 +175,8 @@ function Public.update_minimap()
if Functions.get_player_surface(ic, player) and player.gui.left.minimap_toggle_frame and player_data.auto then
kill_frame(player)
draw_minimap(player)
else
kill_minimap(player)
end
end
end

View File

@ -60,6 +60,17 @@ function Public.get(key)
end
end
function Public.set(key, value)
if key and (value or value == false) then
this[key] = value
return this[key]
elseif key then
return this[key]
else
return this
end
end
function Public.set_car_area(tbl)
if not tbl then
return

View File

@ -1034,7 +1034,7 @@ function Public.toggle_minimap(icw, event)
return
end
local player = game.players[event.player_index]
local is_spamming = SpamProtection.is_spamming(player, 5)
local is_spamming = SpamProtection.is_spamming(player, 5, 'ICW Toggle Minimap')
if is_spamming then
return
end

View File

@ -731,7 +731,7 @@ local function slider_changed(event)
return
end
local is_spamming = SpamProtection.is_spamming(player, 2)
local is_spamming = SpamProtection.is_spamming(player, 2, 'Locomotive Slider Change')
if is_spamming then
return
end
@ -767,7 +767,7 @@ local function text_changed(event)
return
end
local is_spamming = SpamProtection.is_spamming(player, 2)
local is_spamming = SpamProtection.is_spamming(player, 2, 'Locomotive Text Changed')
if is_spamming then
return
end
@ -951,7 +951,7 @@ local function gui_click(event)
return
end
local is_spamming = SpamProtection.is_spamming(player)
local is_spamming = SpamProtection.is_spamming(player, nil, 'Locomotive Gui Clicked')
if is_spamming then
return
end

View File

@ -5,6 +5,7 @@ local BuriedEnemies = require 'maps.mountain_fortress_v3.buried_enemies'
local HS = require 'maps.mountain_fortress_v3.highscore'
local IC = require 'maps.mountain_fortress_v3.ic.table'
local ICMinimap = require 'maps.mountain_fortress_v3.ic.minimap'
local Autostash = require 'modules.autostash'
local Group = require 'comfy_panel.group'
local PL = require 'comfy_panel.player_list'
@ -112,13 +113,13 @@ function Public.reset_map()
Poll.reset()
ICW.reset()
IC.reset()
IC.allowed_surface('mountain_fortress_v3')
IC.allowed_surface(game.surfaces[this.active_surface_index].name)
Functions.reset_table()
game.reset_time_played()
WPT.reset_table()
RPG_Func.rpg_reset_all_players()
RPG_Settings.set_surface_name('mountain_fortress_v3')
RPG_Settings.set_surface_name(game.surfaces[this.active_surface_index].name)
RPG_Settings.enable_health_and_mana_bars(true)
RPG_Settings.enable_wave_defense(true)
RPG_Settings.enable_mana(true)
@ -170,6 +171,7 @@ function Public.reset_map()
if player.gui.left['mvps'] then
player.gui.left['mvps'].destroy()
end
ICMinimap.kill_minimap(player)
end
Difficulty.reset_difficulty_poll({difficulty_poll_closing_timeout = game.tick + 36000})