Restore aura visuals after loading a save
Saving marks effect objects dead, so after a load the Heldenmut / Klingenblick buff was active but its aura effect (cObjectFX 842) was gone. A few ticks after a save game has loaded, the effect is created again for each such buff of a player hero (CreateAt + cEventFX 0x42, as the art's cast effect does), with the buff's remaining time. Shared game events (game/engine/events): engine tick and "save game loaded" callbacks; the WASD mod uses the tick through it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
30c93fc87e
commit
f721d2a486
8 files changed
+217
-26
No files matched your search
+7
-14
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "game/engine/events.h"
|
||||
#include "game/engine/objects.h"
|
||||
#include "mods/input.h"
|
||||
#include "re/hook.h"
|
||||
@@ -126,19 +127,11 @@ void Update(uint8_t* engine) {
|
||||
g_move.moving = true;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct Registration {
|
||||
Registration() { game::OnEngineTick(&Update); }
|
||||
} g_registration;
|
||||
} // namespace
|
||||
|
||||
} // namespace mods::wasd
|
||||
|
||||
namespace game {
|
||||
|
||||
// cEngine::Tick (0x60f1d0, 10 Hz): processes queued events, then the mouse's
|
||||
// hold-to-move re-aim orders.
|
||||
void __fastcall Engine_Tick(void* self, void* edx, void* event);
|
||||
RE_HOOK(0x0060f1d0, Engine_Tick);
|
||||
void __fastcall Engine_Tick(void* self, void* edx, void* event) {
|
||||
Engine_Tick_original(self, edx, event);
|
||||
if (self) {
|
||||
mods::wasd::Update(static_cast<uint8_t*>(self));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace game
|
||||
Reference in new issue
Block a user