Skip to content

Commit

Permalink
fix a u240.3 more weapon stats crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitawastaken committed Dec 25, 2023
1 parent ebb8e95 commit 14b8c5c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/charactertweakdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -872,12 +872,23 @@ Hooks:PostHook(CharacterTweakData, "init", "eclipse_init", function(self)
self.security_mex.chatter = self.presets.enemy_chatter.security
self.security_mex_no_pager.chatter = self.presets.enemy_chatter.security

end)

Hooks:PostHook(CharacterTweakData, "_init_team_ai", "_init_team_ai_bot_weapons", function (self, presets)

-- if bot weapons and equipment is installed and fixed weapon balance is on don't make any further changes
if BotWeapons and BotWeapons.settings and BotWeapons.settings.weapon_balance then
return
end

self.presets.weapon.gang_member = self.presets.weapon.base
for k, v in pairs(self) do
if type(v) == "table" and v.access == "teamAI1" then
v.weapon = clone(presets.weapon.base)
v.weapon.weapons_of_choice = {
primary = "wpn_fps_ass_m4_npc"
}
end
end
end)

-- Add new enemies to the character map
Expand Down

0 comments on commit 14b8c5c

Please sign in to comment.