Divergent/mods/Dynamic NPC Armor Visuals/gamedata/scripts/zzz_npc_loot_armor_patch.sc...

29 lines
694 B
Plaintext
Raw Normal View History

2024-03-17 20:18:03 -04:00
--small patch so NPCs actualy loot armor.
function xr_corpse_detection.get_loot_table(ini)
local t = {}
ini_sys:section_for_each(function(section)
if not (ini:line_exist("ignore_sections",section)) then
if (ini_sys:r_bool_ex(section,"can_trade",true) == true) then
if (ini_sys:r_bool_ex(section,"quest_item",false) == false) then
if not (string.find(section,"mp_")) then
local name = ini_sys:r_string_ex(section,"inv_name")
if (name and name ~= "" and name ~= "default") then
local cost = ini_sys:r_float_ex(section,"cost") or 0
if (cost > 0) then
t[section] = true
end
end
end
end
end
end
end
)
return t
end