From 67d5d8b20c1239dbaf8cf9d7c219b94b20c987b8 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Fri, 5 Nov 2021 22:13:53 -0500 Subject: [PATCH] Added proper NPC melee activities --- sp/src/game/server/ai_activity.cpp | 3 +++ sp/src/game/server/hl2/weapon_crowbar.cpp | 5 ++--- sp/src/game/shared/activitylist.cpp | 3 +++ sp/src/game/shared/ai_activity.h | 4 ++++ sp/src/game/shared/hl2mp/weapon_stunstick.cpp | 7 +++---- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sp/src/game/server/ai_activity.cpp b/sp/src/game/server/ai_activity.cpp index f62e38db..02afb3b7 100644 --- a/sp/src/game/server/ai_activity.cpp +++ b/sp/src/game/server/ai_activity.cpp @@ -2272,6 +2272,9 @@ void CAI_BaseNPC::InitDefaultActivitySR(void) ADD_ACTIVITY_TO_SR( ACT_RANGE_ATTACK_RPG_LOW ); ADD_ACTIVITY_TO_SR( ACT_GESTURE_RANGE_ATTACK_RPG ); + ADD_ACTIVITY_TO_SR( ACT_WALK_MELEE ); + ADD_ACTIVITY_TO_SR( ACT_RUN_MELEE ); + ADD_ACTIVITY_TO_SR( ACT_RUN_PACKAGE ); ADD_ACTIVITY_TO_SR( ACT_RUN_SUITCASE ); diff --git a/sp/src/game/server/hl2/weapon_crowbar.cpp b/sp/src/game/server/hl2/weapon_crowbar.cpp index 1a6488c2..8a0daacf 100644 --- a/sp/src/game/server/hl2/weapon_crowbar.cpp +++ b/sp/src/game/server/hl2/weapon_crowbar.cpp @@ -43,9 +43,8 @@ acttable_t CWeaponCrowbar::m_acttable[] = { ACT_IDLE, ACT_IDLE_ANGRY_MELEE, false }, { ACT_IDLE_ANGRY, ACT_IDLE_ANGRY_MELEE, false }, #ifdef EXPANDED_HL2_WEAPON_ACTIVITIES - // Just so we don't have to implement more activities, re-use the MP acts - { ACT_RUN, ACT_MP_RUN_MELEE, false }, - { ACT_WALK, ACT_MP_WALK_MELEE, false }, + { ACT_RUN, ACT_RUN_MELEE, false }, + { ACT_WALK, ACT_WALK_MELEE, false }, { ACT_ARM, ACT_ARM_MELEE, false }, { ACT_DISARM, ACT_DISARM_MELEE, false }, diff --git a/sp/src/game/shared/activitylist.cpp b/sp/src/game/shared/activitylist.cpp index 95ff2144..ecee2eee 100644 --- a/sp/src/game/shared/activitylist.cpp +++ b/sp/src/game/shared/activitylist.cpp @@ -2388,6 +2388,9 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_RPG_LOW ); REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_RPG ); + REGISTER_SHARED_ACTIVITY( ACT_WALK_MELEE ); + REGISTER_SHARED_ACTIVITY( ACT_RUN_MELEE ); + REGISTER_SHARED_ACTIVITY( ACT_RUN_PACKAGE ); REGISTER_SHARED_ACTIVITY( ACT_RUN_SUITCASE ); diff --git a/sp/src/game/shared/ai_activity.h b/sp/src/game/shared/ai_activity.h index 11845787..ad39c548 100644 --- a/sp/src/game/shared/ai_activity.h +++ b/sp/src/game/shared/ai_activity.h @@ -2267,6 +2267,10 @@ typedef enum ACT_RANGE_ATTACK_RPG_LOW, ACT_GESTURE_RANGE_ATTACK_RPG, + // Melee + ACT_WALK_MELEE, + ACT_RUN_MELEE, + // Citizen accessories ACT_RUN_PACKAGE, ACT_RUN_SUITCASE, diff --git a/sp/src/game/shared/hl2mp/weapon_stunstick.cpp b/sp/src/game/shared/hl2mp/weapon_stunstick.cpp index 0884153e..992bd036 100644 --- a/sp/src/game/shared/hl2mp/weapon_stunstick.cpp +++ b/sp/src/game/shared/hl2mp/weapon_stunstick.cpp @@ -82,10 +82,9 @@ acttable_t CWeaponStunStick::m_acttable[] = { ACT_MELEE_ATTACK1, ACT_MELEE_ATTACK_SWING, true }, { ACT_IDLE_ANGRY, ACT_IDLE_ANGRY_MELEE, true }, #ifdef EXPANDED_HL2_WEAPON_ACTIVITIES - // Just so we don't have to implement more activities, re-use the MP acts - { ACT_IDLE, ACT_MP_STAND_MELEE, false }, - { ACT_RUN, ACT_MP_RUN_MELEE, false }, - { ACT_WALK, ACT_MP_WALK_MELEE, false }, + { ACT_IDLE, ACT_IDLE_MELEE, false }, + { ACT_RUN, ACT_RUN_MELEE, false }, + { ACT_WALK, ACT_WALK_MELEE, false }, #endif };