Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix equipment and base game, fixes #4 , closes #3 #5

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version: 2.1.1
Date: 2022.10.09 20:00:00+00:00
Bugfixes:
- QUICK HOTFIX - Discovered an issue with fusion versus fission for the base game and quick-start-delight. The mod will use `fission` if you are not in "Space Age", and `fusion` if you are. Thanks to https://github.com/Xephi for reporting this issue.

---------------------------------------------------------------------------------------------------
Version: 2.1.0
Date: 2024.10.21 03:00:00+00:00
Expand Down
4 changes: 2 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ script.on_event(defines.events.on_player_created, function(event)
armor_inventory.insert({name = "power-armor-mk2", count = 1})

-- Insert the rest of the equipment into the armor
configure_gear(character, CHARACTER_GEAR)
configure_gear(player, character, CHARACTER_GEAR)

-- Place construction bots, and other items into inventory
load_gear(PLAYER_LOADOUT_FROM_SETTINGS, player, inventory)
Expand All @@ -82,7 +82,7 @@ script.on_event(defines.events.on_player_created, function(event)
spidertron.create_grid()

-- Insert the Spidertron gear
configure_gear(spidertron, SPIDER_GEAR)
configure_gear(player, spidertron, SPIDER_GEAR)

-- The Spidertron is prepared
player.print({"qsd-log-message.info-startup-spidertron"}, COLOR_WHITE)
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quick-start-delight",
"version": "2.1.0",
"version": "2.1.1",
"title": "Quick Start Delight",
"author": "urda",
"homepage": "https://github.com/urda/quick-start-delight",
Expand Down
2 changes: 2 additions & 0 deletions locale/en/strings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ error-no-inventory=Quick Start Delight :: No character inventory found!
error-no-spidertron=Quick Start Delight :: Unable to locate Spidertron!

info-character-init=Quick Start Delight :: Your character has been "quick started" thanks to Urda!
info-space-no-space-fission=Quick Start Delight :: No space age! Bummer. Using fission.
info-space-space-fusion=Quick Start Delight :: Space age detected! Using fusion.
info-startup=Quick Start Delight :: Starting up ...
info-startup-inventory=Quick Start Delight :: Character inventory initialized ...
info-startup-inventory-added-generic=Quick Start Delight :: Added __1__ (x__2__) to inventory ...
Expand Down
12 changes: 11 additions & 1 deletion qsd/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ require("constants")
--
-- @usage configure_gear(character, CHARACTER_GEAR)
--
-- @param target_player The current player
-- @param gear_to_load The target character, spidertron, or other equipment grid.
-- @param gear_loadout The gear to load into the equipment grid.
--
function configure_gear(gear_to_load, gear_loadout)
function configure_gear(target_player, gear_to_load, gear_loadout)
for gear_type, gear_group in pairs(gear_loadout) do
for gear_name, gear_position_array in pairs(gear_group) do
if gear_name == "fusion-reactor-equipment" then
if script.active_mods['space-age'] then
target_player.print({"qsd-log-message.info-space-space-fusion"})
else
gear_name = "fission-reactor-equipment"
target_player.print({"qsd-log-message.info-space-no-space-fission"})
end
end

for key, position in ipairs(gear_position_array) do
local new_gear = gear_to_load.grid.put({name = gear_name, position = position})

Expand Down