Skip to content

Commit

Permalink
More module fixes
Browse files Browse the repository at this point in the history
Fixes autostash filtering not working
Fixes wave defense being broken
Remove unused modules as they are part of base game now
  • Loading branch information
Gerkiz committed Oct 27, 2024
1 parent 7ef0fa3 commit 8e8724a
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 387 deletions.
4 changes: 0 additions & 4 deletions locale/en/modules.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ turret_filler_label_amount=Amount:
turret_filler_ammo_type=Select Ammo:
turret_filler_ammo_lower=Enable lower tiers?

blueprint_requesting=Blueprint Requesting
blueprint_requesting_desc=Placing blueprints into [entity=logistic-chest-requester] or [entity=logistic-chest-buffer] will set the chest requests to match the blueprint costs. Happens when chest is closed.
blueprint_requesting_notify=This server has Blueprint Requesting feature enabled. Placing blueprints into [entity=logistic-chest-requester] or [entity=logistic-chest-buffer] will match the requests to the blueprint costs. You can disable this feature for yourself in Comfy menu -> Config.

[modules_towny]
map_info=__1__\n\n__2__\n\n__3__\n\n__4__\n\n__5__
map_info1=To ally or settle with another town, drop a fish on their market or character. (Default Hotkey Z)\nThey will have to do the same to you to complete the request.\nCoal yields the opposite result, as it will make foes or banish settlers.
Expand Down
3 changes: 0 additions & 3 deletions locale/ru/modules.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ turret_filler_label_enabled=Включено:
turret_filler_label_amount=Количество:
turret_filler_ammo_type=Боеприпасы:
turret_filler_ammo_lower=Включить предыдущие уровни?
blueprint_requesting=Запрос по чертежу
blueprint_requesting_desc=Если положить чертёж в [entity=logistic-chest-requester] или [entity=logistic-chest-buffer], то сундук запросит предметы, нужные для постройки чертежа. Запрос формируется при закрытии сундука.
blueprint_requesting_notify=На этом сервере включена функция "Запрос по чертежу". Если положить чертёж в [entity=logistic-chest-requester] или [entity=logistic-chest-buffer], то сундук запросит предметы, нужные для постройки чертежа. Вы можете отключить функцию в меню Comfy -> Config.

[modules_towny]
map_info=__1__\n\n__2__\n\n__3__\n\n__4__\n\n__5__
Expand Down
1 change: 1 addition & 0 deletions maps/mountain_fortress_v3/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,7 @@ function Public.set_player_to_spectator(player)
return false
end


if player.driving then
return player.print('[color=blue][Spectate][/color] Please exit the vehicle before continuing', { color = Color.warning })
end
Expand Down
7 changes: 7 additions & 0 deletions maps/mountain_fortress_v3/gui.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local Event = require 'utils.event'
local Public = require 'maps.mountain_fortress_v3.table'
local Color = require 'utils.color_presets'
local RPG = require 'modules.rpg.main'
local IC_Gui = require 'maps.mountain_fortress_v3.ic.gui'
local IC_Minimap = require 'maps.mountain_fortress_v3.ic.minimap'
Expand Down Expand Up @@ -101,6 +102,7 @@ local function spectate_button(player)
return
end


if Public.get('final_battle') then
return
end
Expand Down Expand Up @@ -684,6 +686,11 @@ Gui.on_click(
return
end

if Public.get('spectate_button_disable') then
player.print('Spectate button is disabled until a bug has been fixed in the base game.', { color = Color.yellow })
return
end

if player.character and player.character.valid then
local success = Public.set_player_to_spectator(player)
if success then
Expand Down
24 changes: 7 additions & 17 deletions maps/mountain_fortress_v3/ic/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ local function validate_entity(entity)
return true
end

local get_filters = function (points)
local filters = {}
for _, section in pairs(points.sections) do
for _, filter in pairs(section.filters) do
if filter and filter.value and filter.value.name then
filters[#filters + 1] = filter
end
end
end
return filters
end

---Returns the car from the unit_number.
---@param unit_number any
---@return table|boolean
Expand Down Expand Up @@ -573,7 +561,7 @@ local function input_filtered(car_inv, chest, chest_inv, free_slots)

local prototypes = prototypes.item
local logistics = chest.get_logistic_point(defines.logistic_member_index.logistic_container)
local filters = get_filters(logistics)
local filters = Core.get_filters(logistics)
for _, filter in pairs(filters) do
if filter.value.name then
request_stacks[filter.value.name] = 10 * prototypes[filter.value.name].stack_size
Expand Down Expand Up @@ -621,10 +609,12 @@ local function input_cargo(car, chest)

local has_request_slot = false
local logistics = chest.get_logistic_point(defines.logistic_member_index.logistic_container)
local filters = get_filters(logistics)
for _, filter in pairs(filters) do
if filter.value.name then
has_request_slot = true
if logistics then
local filters = Core.get_filters(logistics)
for _, filter in pairs(filters) do
if filter.value.name then
has_request_slot = true
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion maps/mountain_fortress_v3/ic/table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Public.reset()
for k, _ in pairs(this) do
this[k] = nil
end
this.debug_mode = true
this.debug_mode = false
this.restore_on_theft = false
this.doors = {}
this.cars = {}
Expand Down
6 changes: 5 additions & 1 deletion maps/mountain_fortress_v3/icw/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ local function connect_power_pole(entity, wagon_area_left_top_y)
}
for _, pole in pairs(surface.find_entities_filtered({ area = area, name = entity.name })) do
if pole.position.y < wagon_area_left_top_y then
entity.connect_neighbour(pole)
local source_wire = entity.get_wire_connector(5)
local target_wire = pole.get_wire_connector(5)
if source_wire and target_wire then
source_wire.connect_to(target_wire, false)
end
return
end
end
Expand Down
Loading

0 comments on commit 8e8724a

Please sign in to comment.