mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-13 05:57:41 -04:00
Fix Outside ToT crash when using din's or dying (#6731)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include <libultraship/bridge.h>
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
// Dying or using Din's Fire in the Outside Temple of Time area crashes the game.
|
||||
// In vanilla this can never happen, but with CrowdControl, Sail, Unrestricted Items
|
||||
// and others this *can* happen. Because it checks for a camId of -1, this code path
|
||||
// shouldn't ever influence vanilla play regardless.
|
||||
void RegisterFixOutsideTotCrash() {
|
||||
COND_VB_SHOULD(VB_SHOULD_LOAD_BG_IMAGE, true, {
|
||||
int32_t* camId = va_arg(args, int*);
|
||||
if (*camId == -1) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterFixOutsideTotCrash, { "" });
|
||||
@@ -21,12 +21,6 @@ void OnGameFrameUpdateUnrestrictedItems() {
|
||||
|
||||
void RegisterUnrestrictedItems() {
|
||||
COND_HOOK(OnGameFrameUpdate, CVAR_UNRESTRICTED_ITEMS_VALUE, OnGameFrameUpdateUnrestrictedItems);
|
||||
COND_VB_SHOULD(VB_SHOULD_LOAD_BG_IMAGE, CVAR_UNRESTRICTED_ITEMS_VALUE, {
|
||||
int32_t* camId = va_arg(args, int*);
|
||||
if (*camId == -1) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterUnrestrictedItems, { CVAR_UNRESTRICTED_ITEMS_NAME });
|
||||
|
||||
@@ -681,14 +681,3 @@ std::unique_ptr<CrowdControl::Effect> CrowdControl::ParseMessage(nlohmann::json
|
||||
|
||||
return effect;
|
||||
}
|
||||
|
||||
void RegisterCrowdControlHooks() {
|
||||
COND_VB_SHOULD(VB_SHOULD_LOAD_BG_IMAGE, CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0), {
|
||||
int32_t* camId = va_arg(args, int*);
|
||||
if (*camId == -1) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterCrowdControlHooks, { CVAR_REMOTE_CROWD_CONTROL("Enabled") });
|
||||
|
||||
Reference in New Issue
Block a user