From ea655b15c09ed47ca06225b6efde43005eeb7ba1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Dec 2025 05:47:21 +0000 Subject: [PATCH] [SP] Fix animation event sounds not playing for NPC variants Use the anim file set's model name instead of NPC_type for the modelOnly filter check. NPC variants like "stormtrooper2" share the same model and anim events as the base NPC, so we need to match against the model name. Fixes: JACoders/OpenJK#1287 --- code/cgame/cg_players.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/cgame/cg_players.cpp b/code/cgame/cg_players.cpp index a6f6b67f0d..65deb355bb 100644 --- a/code/cgame/cg_players.cpp +++ b/code/cgame/cg_players.cpp @@ -1220,7 +1220,9 @@ static void CG_PlayerAnimEvents( int animFileIndex, qboolean torso, int oldFrame } } - hstring myModel = g_entities[entNum].NPC_type; //apparently NPC_type is always the same as the model name??? + // Use the anim file set's model name instead of NPC_type, since NPC variants + // (e.g., "stormtrooper2") share the same model and anim events as the base NPC + hstring myModel = level.knownAnimFileSets[animFileIndex].filename; // Check for anim event for ( i=0; i < MAX_ANIM_EVENTS; ++i )