From 3ac1f39912f796fefb5e6962e0f2a1f1db05ec67 Mon Sep 17 00:00:00 2001 From: Alan Shen Date: Mon, 9 Nov 2026 18:54:00 -0700 Subject: [PATCH] Keep an empty Tachi's slide back while lowered An empty Tachi idles with its slide held back, but a sprint or a ladder sends ACT_VM_IDLE_LOWERED, whose shipped clip has the slide forward, so the slide closes until the gun is raised again. An empty weapon now plays ACT_VM_IDLE_LOWERED_EMPTY instead, next to the existing empty-idle swap, when its model has a sequence for it. Models without one, such as the shipped MilSO, behave as before. --- src/game/shared/activitylist.cpp | 4 ++++ src/game/shared/ai_activity.h | 4 ++++ .../shared/neo/weapons/weapon_neobasecombatweapon.cpp | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/game/shared/activitylist.cpp b/src/game/shared/activitylist.cpp index 6fa0686235..4e191d6704 100644 --- a/src/game/shared/activitylist.cpp +++ b/src/game/shared/activitylist.cpp @@ -2537,6 +2537,10 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_MP_CYOA_PDA_INTRO ); REGISTER_SHARED_ACTIVITY( ACT_MP_CYOA_PDA_IDLE ); REGISTER_SHARED_ACTIVITY( ACT_MP_CYOA_PDA_OUTRO ); + +#ifdef NEO + REGISTER_SHARED_ACTIVITY( ACT_VM_IDLE_LOWERED_EMPTY ); +#endif AssertMsg( g_HighestActivity == LAST_SHARED_ACTIVITY - 1, "Not all activities from ai_activity.h registered in activitylist.cpp" ); } diff --git a/src/game/shared/ai_activity.h b/src/game/shared/ai_activity.h index 3702cb839e..8bf16990a0 100644 --- a/src/game/shared/ai_activity.h +++ b/src/game/shared/ai_activity.h @@ -2363,6 +2363,10 @@ typedef enum ACT_MP_CYOA_PDA_IDLE, ACT_MP_CYOA_PDA_OUTRO, +#ifdef NEO + ACT_VM_IDLE_LOWERED_EMPTY, +#endif + // this is the end of the global activities, private per-monster activities start here. LAST_SHARED_ACTIVITY, diff --git a/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp b/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp index 979d70f8a7..276ad4fe46 100644 --- a/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp +++ b/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp @@ -989,13 +989,19 @@ void CNEOBaseCombatWeapon::DryFire() m_flNextPrimaryAttack = gpGlobals->curtime + GetFastestDryRefireTime(); // SequenceDuration(); } -// An empty weapon idles on its empty sequence where the model has one, such as a pistol with its slide held back +// An empty weapon idles, raised or lowered, on its empty sequence where the model has one, +// such as a pistol with its slide held back bool CNEOBaseCombatWeapon::SendWeaponAnim(int iActivity) { if (iActivity == ACT_VM_IDLE && UsesClipsForAmmo1() && m_iClip1 <= 0 && HasEmptyIdle()) { iActivity = ACT_VM_IDLE_EMPTY; } + else if (iActivity == ACT_VM_IDLE_LOWERED && UsesClipsForAmmo1() && m_iClip1 <= 0 + && SelectWeightedSequence(ACT_VM_IDLE_LOWERED_EMPTY) != ACTIVITY_NOT_AVAILABLE) + { + iActivity = ACT_VM_IDLE_LOWERED_EMPTY; + } return BaseClass::SendWeaponAnim(iActivity); }