summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/studio.cpp13
1 files changed, 12 insertions, 1 deletions
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) {
75} 75}
76 76
77bool is_prop_model(const char *name) { 77bool is_prop_model(const char *name) {
78 return name && strncmp(name, "models/props", 12) == 0; 78 if (!name)
79 return false;
80 // studiohdr_t::name is the short model name with Windows separators, e.g.
81 // "props_junk\wood_crate002a.mdl" (the "models/" prefix is stripped).
82 if (strncmp(name, "models/", 7) == 0 || strncmp(name, "models\\", 7) == 0)
83 name += 7;
84 if (strncmp(name, "props_skybox", 12) == 0 ||
85 strncmp(name, "props\\skybox", 13) == 0)
86 return false; // distant 3D-skybox props
87 return strncmp(name, "props/", 6) == 0 ||
88 strncmp(name, "props\\", 6) == 0 ||
89 strncmp(name, "props_", 6) == 0;
79} 90}
80 91
81void hook_set_color(void *self, const float *color) { 92void hook_set_color(void *self, const float *color) {