From 14b8c5cc763f5dfc733ae157e288d53d16a60a7e Mon Sep 17 00:00:00 2001 From: nikita <59087849+mrcreepysos@users.noreply.github.com> Date: Tue, 26 Dec 2023 00:22:19 +0300 Subject: [PATCH] fix a u240.3 more weapon stats crash --- lua/charactertweakdata.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/charactertweakdata.lua b/lua/charactertweakdata.lua index 202bc95..d7261e2 100644 --- a/lua/charactertweakdata.lua +++ b/lua/charactertweakdata.lua @@ -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