From 7533d67fd7987312c3e25cb9856f1250d5390035 Mon Sep 17 00:00:00 2001 From: nikita <59087849+mrcreepysos@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:54:40 +0300 Subject: [PATCH] sh catchup Co-Authored-By: Sebastian Gabl (aka Hoppip) --- lua/copactionwalk.lua | 18 ++++-------------- lua/groupaistatebesiege.lua | 4 ++++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/lua/copactionwalk.lua b/lua/copactionwalk.lua index 9628576..50fee10 100644 --- a/lua/copactionwalk.lua +++ b/lua/copactionwalk.lua @@ -17,27 +17,17 @@ function CopActionWalk:_adjust_move_anim(side, speed) local move_side = anim_data.move_side if move_side and (side == move_side or self._matching_walk_anims[side][move_side]) then local seg_rel_t = self._machine:segment_relative_time(idstr_base) + local pose = anim_data.pose or self._fallback_pos - if - not self._walk_anim_lengths[anim_data.pose] - or not self._walk_anim_lengths[anim_data.pose][self._stance.name] - or not self._walk_anim_lengths[anim_data.pose][self._stance.name][speed] - or not self._walk_anim_lengths[anim_data.pose][self._stance.name][speed][side] - then + if not self._walk_anim_lengths[pose] or not self._walk_anim_lengths[pose][self._stance.name] or not self._walk_anim_lengths[pose][self._stance.name][speed] or not self._walk_anim_lengths[pose][self._stance.name][speed][side] then return end - local walk_anim_length = self._walk_anim_lengths[anim_data.pose][self._stance.name][speed][side] + local walk_anim_length = self._walk_anim_lengths[pose][self._stance.name][speed][side] enter_t = seg_rel_t * walk_anim_length end - local could_freeze = anim_data.can_freeze and anim_data.upper_body_empty - local redir_res = self._ext_movement:play_redirect(redirect_name, enter_t) - if could_freeze then - self._ext_base:chk_freeze_anims() - end - - return redir_res + return self._ext_movement:play_redirect(redirect_name, enter_t) end -- Fix potential crash when walk action gets interrupted on client diff --git a/lua/groupaistatebesiege.lua b/lua/groupaistatebesiege.lua index 5c816e1..1db879a 100644 --- a/lua/groupaistatebesiege.lua +++ b/lua/groupaistatebesiege.lua @@ -798,6 +798,10 @@ end -- Group spawning now always spawns the entire group at once but uses a cooldown that prevents any group spawns of the same type for a short duration -- The special limit check is now done earlier to prevent groups that can't actually spawn from being picked and wasting a spawn cycle function GroupAIStateBesiege:force_spawn_group(group, group_types, guarantee) + if not self._ai_enabled then + return + end + local best_groups = {} local total_weight = self:_choose_best_groups(best_groups, group, group_types, self._tweak_data[self._task_data.assault.active and "assault" or "recon"].groups, 1) if total_weight <= 0 and not guarantee then