The only way would be tracking LoadDef and Def->Destruct functions in order to find out the location of loaded defs in memory (which game structure), I suppose, with further unloading/reloading. Anyway, it does not seems as reliable solution. Once the object is drawn and not removed, resource counter is kept > 1, resource is not released and SN:R simply cannot redirect anything. SN:R intercepts LoadDef function, changing argument "name". After resource is loaded and stored in memory, nobody can force the game or plugin to use other def. The only exception are png frames, which ignore already loaded DEF frames.
Maybe another redirection mechanism could help. Something redirecting def drawing functions to other def frames on the fly. I didn't implement it yet. In your example 195z.def is not loaded, thus when we redirect 196z.def frame to 195z.def we should load def from archive, draw single frame and release memory, which would be very slow, unless implementing some time-limited cache.
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|