From 0aaf7b61a5c7bd63cf8cdeef8de76e5a609f4e61 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 11:32:47 +0100 Subject: Props: match the studio model name format studiohdr_t::name is not "models/props/...". In this build it is the short model name with Windows separators, e.g. "props_junk\wood_crate002a.mdl" (the models/ prefix is stripped). Normalise the prefix/separators and match props/, props\ and props_ (excluding the distant props_skybox set), so the studio hooks actually recognise prop draws. --- src/studio.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/studio.cpp') diff --git a/src/studio.cpp b/src/studio.cpp index fa004de..baabcfa 100644 --- a/src/studio.cpp +++ b/src/studio.cpp @@ -75,7 +75,18 @@ const char *info_model_name(void *info) { } bool is_prop_model(const char *name) { - return name && strncmp(name, "models/props", 12) == 0; + if (!name) + return false; + // studiohdr_t::name is the short model name with Windows separators, e.g. + // "props_junk\wood_crate002a.mdl" (the "models/" prefix is stripped). + if (strncmp(name, "models/", 7) == 0 || strncmp(name, "models\\", 7) == 0) + name += 7; + if (strncmp(name, "props_skybox", 12) == 0 || + strncmp(name, "props\\skybox", 13) == 0) + return false; // distant 3D-skybox props + return strncmp(name, "props/", 6) == 0 || + strncmp(name, "props\\", 6) == 0 || + strncmp(name, "props_", 6) == 0; } void hook_set_color(void *self, const float *color) { -- cgit v1.2.3