mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-10-13 07:25:54 -04:00
Fix Link being out of bounds while loading into scene on epona with spinning free cam (#7270)
This commit is contained in:
+15
-3
@@ -8,10 +8,13 @@
|
||||
|
||||
extern "C" {
|
||||
#include "global.h"
|
||||
#include "src/overlays/actors/ovl_En_Horse/z_en_horse.h"
|
||||
}
|
||||
|
||||
void RegisterFreeLookDoorCamRelease() {
|
||||
COND_VB_SHOULD(VB_RELEASE_DOORC_CAMERA, CVarGetInteger(CVAR_SETTING("FreeLook.Enabled"), 0), {
|
||||
void RegisterFreeLookFixes() {
|
||||
bool freeLook = CVarGetInteger(CVAR_SETTING("FreeLook.Enabled"), 0);
|
||||
|
||||
COND_VB_SHOULD(VB_RELEASE_DOORC_CAMERA, freeLook, {
|
||||
Camera* camera = va_arg(args, Camera*);
|
||||
|
||||
// Also release the door peek camera when free look moves it, reusing SetCameraManual's threshold.
|
||||
@@ -23,6 +26,15 @@ void RegisterFreeLookDoorCamRelease() {
|
||||
*should = true;
|
||||
}
|
||||
});
|
||||
|
||||
// EnHorse_Init sets riderPos as a world position instead of an offset,
|
||||
// putting Link out of bounds until horse drawn.
|
||||
COND_ID_HOOK(OnActorInit, ACTOR_EN_HORSE, freeLook, [](void* refActor) {
|
||||
EnHorse* enHorse = reinterpret_cast<EnHorse*>(refActor);
|
||||
enHorse->riderPos.x = 0.0f;
|
||||
enHorse->riderPos.y = 70.0f;
|
||||
enHorse->riderPos.z = 0.0f;
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterFreeLookDoorCamRelease, { CVAR_SETTING("FreeLook.Enabled") });
|
||||
static RegisterShipInitFunc initFunc(RegisterFreeLookFixes, { CVAR_SETTING("FreeLook.Enabled") });
|
||||
Reference in New Issue
Block a user