diff options
| -rw-r--r-- | src/studio.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/studio.cpp b/src/studio.cpp index f815c16..b428a26 100644 --- a/src/studio.cpp +++ b/src/studio.cpp | |||
| @@ -285,12 +285,18 @@ void hkdModelExecute(void *self, const void *state, const void *info, | |||
| 285 | bool is_npc = esp_is_npc_index(idx); | 285 | bool is_npc = esp_is_npc_index(idx); |
| 286 | bool is_vm = g_chams_viewmodel && esp_is_viewmodel_index(idx); | 286 | bool is_vm = g_chams_viewmodel && esp_is_viewmodel_index(idx); |
| 287 | if (is_npc || is_vm) { | 287 | if (is_npc || is_vm) { |
| 288 | void *mat = is_vm ? viewmodel_material() : chams_material(); | 288 | int style = g_chams_mat_index; |
| 289 | if (style < 0) style = 0; | ||
| 290 | if (style > 5) style = 5; | ||
| 291 | // VGUI materials do not draw skinned models: use the solid model | ||
| 292 | // shader for the viewmodel with the same flags (flat/additive). | ||
| 293 | bool vgui_style = (style == 0 || style == 2); | ||
| 294 | void *mat = (is_vm && vgui_style) ? viewmodel_material() | ||
| 295 | : chams_material(); | ||
| 296 | if (!mat) | ||
| 297 | mat = viewmodel_material(); | ||
| 289 | if (mat) { | 298 | if (mat) { |
| 290 | int style = is_vm ? 3 : g_chams_mat_index; | 299 | bool white = style == 4; |
| 291 | if (style < 0) style = 0; | ||
| 292 | if (style > 5) style = 5; | ||
| 293 | bool white = !is_vm && style == 4; | ||
| 294 | if (g_chams_walls && !is_vm) { | 300 | if (g_chams_walls && !is_vm) { |
| 295 | chams_apply(mat, true, style, white); | 301 | chams_apply(mat, true, style, white); |
| 296 | g_force_override(self, mat, 0 /* OVERRIDE_NORMAL */); | 302 | g_force_override(self, mat, 0 /* OVERRIDE_NORMAL */); |
