Files
KalmarvandClaude Opus 5.5 3468f556b0 Lights: a level with more of one kind than the game's table holds no longer crashes it
The game keeps each kind of light (PbrSpotLight, PbrSphereLight, ...) in a
table of 8,192 and crashes at Skate.exe+0x4ea4094 when a level makes more.
- Each kind's light factory is hooked: once the kind's table is nearly full
  it gives no entity, as the game's own factory does for a light it should
  not make. The light is not drawn and the game goes on.
- Said in the log: the kind of light and how many were left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 09:40:06 -06:00

13 lines
567 B
C++

#pragma once
#include <cstdint>
// The game keeps each kind of light (PbrSpotLight, PbrSphereLight, ...) in a table of 8,192 and
// crashes when a level makes more (Engine/Game/Build/<build>/light_tables.h). Once a kind's table is
// nearly full, the guard has the game make no more lights of that kind: they are not drawn, where
// the game would have crashed.
namespace dingosdk::light_table_guard {
// Checks this build's functions and hooks the six light factories; once. False when the build
// differs (no guard).
bool install(std::uintptr_t base) noexcept;
}