Skip to content

Additional Ammo | Parts on Hover Fix #172

@Singustromo

Description

@Singustromo


local ammo_parts_str = ini_ammo:r_string_ex("ammo_vanilla",parent_sec) or ini_ammo_bas:r_string_ex("ammo_bas",parent_sec)

A simple fix for (future) additional ammunition of a possibly overlooked feature.
Not a problem with base gamma. Would be great to fix, though.

Since G.A.M.M.A includes a version of Arti's Ammo Maker, configs/items/ammo/importer.ltx should be read here instead:

diff --git a/gamedata/scripts/itms_manager.script b/gamedata/scripts/itms_manager.script
--- a/gamedata/scripts/itms_manager.script
+++ b/gamedata/scripts/itms_manager.script
@@ -30,8 +30,7 @@ ini_parts = ini_file("items\\settings\\parts.ltx")
 ini_craft = ini_file("items\\settings\\craft.ltx")
 ini_death = ini_file("items\\settings\\death_generic.ltx")
 ini_reward = ini_file("items\\settings\\item_rewards.ltx")
-ini_ammo = ini_file("items\\ammo\\ammo_vanilla.ltx")
-ini_ammo_bas = ini_file("items\\ammo\\ammo_bas.ltx")
+ini_ammo = ini_file("items\\ammo\\importer.ltx")

 local n = 0
 local result,id,value = "","",""
@@ -451,7 +450,8 @@ function ActorMenu_on_item_focus_receive(obj) -- highlight compatible items
                local parts = parts_str and (parts_str ~= "") and str_explode(parts_str,",")

                if IsItem("ammo", parent_sec) then
-                       local ammo_parts_str = ini_ammo:r_string_ex("ammo_vanilla",parent_sec) or ini_ammo_bas:r_string_ex("ammo_bas",parent_sec)
+                       local ammo_parts_str = ini_ammo:r_string_ex("ammo_vanilla",parent_sec)
+                               or ini_ammo:r_string_ex("ammo_bas",parent_sec)
                        if ammo_parts_str and ammo_parts_str ~= "" then
                                parts = str_explode(ammo_parts_str,",")
                        end

This obviously assumes, that additional ammo will be added by an addon via DLTX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions