Skip to content

Commit

Permalink
sh catchup
Browse files Browse the repository at this point in the history
Co-Authored-By: Sebastian Gabl (aka Hoppip) <sebastian.gabl@gmx.at>
  • Loading branch information
nikitawastaken and segabl committed Aug 5, 2024
1 parent f4d4a17 commit 7533d67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lua/copactionwalk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lua/groupaistatebesiege.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7533d67

Please sign in to comment.