1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-30 04:40:54 +02:00

config fix and scrapyard reset

This commit is contained in:
Gerkiz 2020-04-27 23:41:34 +02:00
parent f027df4eb4
commit 2379198e49
2 changed files with 5 additions and 2 deletions

View File

@ -174,6 +174,7 @@ local build_config_gui = (function (player, frame)
local switch_state = "right"
if not poll_table[player.index] then switch_state = "left" end
local switch = add_switch(frame, switch_state, "comfy_panel_poll_no_notify_toggle", "Notify on polls", "Receive a message when new polls are created and popup the poll.")
frame.add({type = "line"})
end
local label = frame.add({type = "label", caption = "Admin Settings"})
@ -200,6 +201,7 @@ local build_config_gui = (function (player, frame)
if not admin then switch.ignored_by_interaction = true end
if package.loaded['comfy_panel.poll'] then
frame.add({type = "line"})
local switch_state = "right"
if global.comfy_panel_config.poll_trusted then switch_state = "left" end
local switch = add_switch(frame, switch_state, "comfy_panel_poll_trusted_toggle", "Poll mode", "Disables non-trusted plebs to create polls.")

View File

@ -32,6 +32,7 @@ local Scrap_table = require "maps.scrapyard.table"
local Locomotive = require "maps.scrapyard.locomotive".locomotive_spawn
local render_train_hp = require "maps.scrapyard.locomotive".render_train_hp
local Score = require "comfy_panel.score"
local Poll = require "comfy_panel.poll"
local Public = {}
local math_random = math.random
@ -61,7 +62,6 @@ local function set_objective_health(final_damage_amount)
this.locomotive_health = math_floor(this.locomotive_health - final_damage_amount)
if this.locomotive_health > this.locomotive_max_health then this.locomotive_health = this.locomotive_max_health end
if this.locomotive_health <= 0 then
log("train died")
Public.loco_died()
end
rendering.set_text(this.health_text, "HP: " .. this.locomotive_health .. " / " .. this.locomotive_max_health)
@ -71,6 +71,7 @@ function Public.reset_map()
local this = Scrap_table.get_table()
local wave_defense_table = WD.get_table()
local get_score = Score.get_table()
Poll.reset()
ICW.reset()
game.reset_time_played()
Scrap_table.reset_table()
@ -259,7 +260,7 @@ end
local function protect_this(entity)
local this = Scrap_table.get_table()
if entity.surface.name ~= "scrapyard" then log("true")return true end
if entity.surface.name ~= "scrapyard" then return true end
local protected = {this.locomotive, this.locomotive_cargo}
for i = 1, #protected do
if protected[i] == entity then