From b287fc803c73d3ae076c49d726e17e13faa15050 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 11:39:18 +0100 Subject: Props: disable StudioRender hooks, fix m_clrRender offset Hooking IStudioRender's draw/setter slots made matched props render the error material and then crashed the material system ("debug/modelstats has bad reference count 0 when being bound"). Keep the hook code for reference but do not install it. Fix the m_clrRender netvar resolution: the walk picked an embedded table entry at offset 0, so the earlier entity writes stomped entity vtables. Only accept offsets inside C_BaseEntity (0x20..0x2000), then write the prop colour there for models/props entities. Restore white when disabled. --- src/studio.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/studio.cpp') diff --git a/src/studio.cpp b/src/studio.cpp index baabcfa..c63ddab 100644 --- a/src/studio.cpp +++ b/src/studio.cpp @@ -201,6 +201,10 @@ void studio_props_init() { if (g_install_tried) return; g_install_tried = true; + // Disabled: replacing IStudioRender draw/setter entries corrupted material + // state (error-material props, bad reference counts, crash). Prop tint uses + // the entity render colour path in esp.cpp instead. + return; std::string path = loaded_module_path("studiorender"); void *h = nullptr; -- cgit v1.2.3