From 3249caf17de0dcab005398995ef3e611b3f81131 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 3 Nov 2026 23:07:40 +0100 Subject: AI: fix relationship lookup; classify citizen/hacked turrets m_Relationship is DEFINE_UTLVECTOR (FIELD_CUSTOM), not FIELD_EMBEDDED, so the datamap scan always returned -1 and every NPC fell back to the model heuristic. Resolve it as FIELD_CUSTOM with an embedded fallback. Floor turrets never add relationship rows when friendly: CNPC_FloorTurret overrides Classify() to CLASS_PLAYER_ALLY for citizen-built (SF_FLOOR_TURRET_CITIZEN) and Alyx-hacked turrets. Read m_spawnflags and m_bHackedByAlyx from the server instead. Widen the datamap offset window (0x4..0x4000) for derived-class fields and log the new offsets plus turret state in the NPC debug line. --- src/hl2h.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/hl2h.h') diff --git a/src/hl2h.h b/src/hl2h.h index 414e061..2824d3c 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -254,6 +254,7 @@ bool server_set_velocity_z(int idx, float vz); int server_active_weapon(int idx); int server_npc_relation(int idx, int local_idx); bool server_npc_has_follow_target(int idx); +int server_npc_turret_flags(int idx); int server_model_index(void *base); void find_modules(); void init_conmsg(); -- cgit v1.2.3