diff --git a/src/reverse/Addresses.h b/src/reverse/Addresses.h index 352a3217..ac68dff1 100644 --- a/src/reverse/Addresses.h +++ b/src/reverse/Addresses.h @@ -20,11 +20,11 @@ constexpr uint32_t CInitializationState_OnTick = 2447710505UL; constexpr uint32_t CPatches_BoundaryTeleport = 887623293UL; constexpr uint32_t CPatches_IntroMovie = 4056423627UL; constexpr uint32_t CPatches_Vignette = 1592528795UL; -constexpr uint32_t CPatches_OptionsInit = 2920158527UL; +constexpr uint32_t CPatches_OptionsInit = 4089777341UL; // Config::IConfigVar::Register #pragma endregion #pragma region CPhotoMode -constexpr uint32_t CPhotoMode_SetRecordID = 2826047827UL; +constexpr uint32_t CPhotoMode_SetRecordID = 4052428712UL; #pragma endregion #pragma region CRenderGlobal diff --git a/src/reverse/ResourceAsyncReference.cpp b/src/reverse/ResourceAsyncReference.cpp index 5c597a05..351ae45c 100644 --- a/src/reverse/ResourceAsyncReference.cpp +++ b/src/reverse/ResourceAsyncReference.cpp @@ -13,18 +13,12 @@ ResourceAsyncReference::ResourceAsyncReference( uint64_t ResourceAsyncReference::Hash(const std::string& aPath) { - // Should probably be moved to RED4ext.SDK after fixing RED4ext::RaRef - // Needs normalization - // 1) all lower case - // 2) / becomes \ - // 3) /\/\\ becomes \ - - return RED4ext::FNV1a64(aPath.c_str()); + return RED4ext::ResourcePath(aPath.c_str()); } RED4ext::ScriptInstance ResourceAsyncReference::GetHandle() const { - return const_cast*>(&m_reference); + return nullptr; } RED4ext::ScriptInstance ResourceAsyncReference::GetValuePtr() const @@ -46,7 +40,7 @@ sol::object ResourceAsyncReference::GetLuaHash() const RED4ext::CStackType stackType; stackType.type = s_uint64Type; - stackType.value = GetHandle(); + stackType.value = const_cast*>(&m_reference); return Converter::ToLua(stackType, lockedState); } diff --git a/src/scripting/GameOptions.cpp b/src/scripting/GameOptions.cpp index 90e0663f..9e9a6d6d 100644 --- a/src/scripting/GameOptions.cpp +++ b/src/scripting/GameOptions.cpp @@ -220,9 +220,7 @@ void GameOptions::Set(const std::string& category, const std::string& name, cons return; const auto consoleLogger = spdlog::get("scripting"); - if (option->Set(value)) - consoleLogger->info(option->GetInfo()); - else + if (!option->Set(value)) { if (option->GetType() == GameOption::kString) consoleLogger->error("Failed to set game option '{}/{}', can't set string options right now.", category, name); @@ -238,9 +236,7 @@ void GameOptions::SetBool(const std::string& category, const std::string& name, return; const auto consoleLogger = spdlog::get("scripting"); - if (option->SetBool(value)) - consoleLogger->info(option->GetInfo()); - else + if (!option->SetBool(value)) { if (option->GetType() != GameOption::kBoolean) consoleLogger->error("Failed to set game option '{}/{}', not a boolean.", category, name); @@ -256,9 +252,7 @@ void GameOptions::SetInt(const std::string& category, const std::string& name, i return; const auto consoleLogger = spdlog::get("scripting"); - if (option->SetInt(value)) - consoleLogger->info(option->GetInfo()); - else + if (!option->SetInt(value)) { if (option->GetType() != GameOption::kInteger && option->GetType() != GameOption::kColor) consoleLogger->error("Failed to set game option '{}/{}', not an integer.", category, name); @@ -274,9 +268,7 @@ void GameOptions::SetFloat(const std::string& category, const std::string& name, return; const auto consoleLogger = spdlog::get("scripting"); - if (option->SetFloat(value)) - consoleLogger->info(option->GetInfo()); - else + if (!option->SetFloat(value)) { if (option->GetType() != GameOption::kFloat) consoleLogger->error("Failed to set game option '{}/{}', not a float.", category, name); @@ -292,9 +284,7 @@ void GameOptions::Toggle(const std::string& category, const std::string& name) return; const auto consoleLogger = spdlog::get("scripting"); - if (option->Toggle()) - consoleLogger->info(option->GetInfo()); - else + if (!option->Toggle()) { if (option->GetType() != GameOption::kBoolean) consoleLogger->error("Failed to set game option '{}/{}', not a boolean.", category, name);