summaryrefslogtreecommitdiffstats
path: root/src/esp.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 01:16:51 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 01:16:51 +0100
commit76c88403d18ef01e8f15b89fcd6d09f0825a1bfc (patch)
tree04049208055fb0533af01a46a2a96c2b9ce491a5 /src/esp.cpp
parentWorld tint: colour dynamic props through m_clrRender (diff)
downloadhl2h-76c88403d18ef01e8f15b89fcd6d09f0825a1bfc.tar.gz
hl2h-76c88403d18ef01e8f15b89fcd6d09f0825a1bfc.zip
World tint: tint map-static props through IStudioRender
Most of the crates are prop_static, which have no client entity, so writing m_clrRender only reached the three dynamic ones. Hook the StudioRender interface (VStudioRender025) on the interface object's vtable: substitute the prop colour in SetColorModulation/SetAlphaModulation while DrawModelStaticProp is drawing a models/props model, and set the modulation explicitly before the original draw in case the engine sets it just before the call. Vtable indices verified by disassembling CStudioRenderContext: 27 = three float stores from the argument pointer, 28 = one float, 30 = the DrawModelInfo_t-drawing entry with three arguments (the 2013 SDK header lists these slots five positions earlier in this build).
Diffstat (limited to '')
-rw-r--r--src/esp.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/esp.cpp b/src/esp.cpp
index 9d041b0..67fbad2 100644
--- a/src/esp.cpp
+++ b/src/esp.cpp
@@ -1413,6 +1413,8 @@ void prop_tint_update() {
1413 static bool logged_missing = false; 1413 static bool logged_missing = false;
1414 static bool logged_touched = false; 1414 static bool logged_touched = false;
1415 bool on = feature_active(FEAT_WORLD_TINT) && g_tint_prop_on; 1415 bool on = feature_active(FEAT_WORLD_TINT) && g_tint_prop_on;
1416 if (on)
1417 studio_props_init();
1416 if (!on && !applied) 1418 if (!on && !applied)
1417 return; 1419 return;
1418 if (!g_iface.entitylist || g_net.clr_render < 0) { 1420 if (!g_iface.entitylist || g_net.clr_render < 0) {