diff --git a/src/custom/vehcustmzr.cpp b/src/custom/vehcustmzr.cpp index a007a79..e48a8e9 100644 --- a/src/custom/vehcustmzr.cpp +++ b/src/custom/vehcustmzr.cpp @@ -212,10 +212,10 @@ VehCustmzrMgr& VehCustmzr = VehCustmzrMgr::Get(); VehCustmzrMgr::VehCustmzrMgr() { - m_CustomizeData.m_bAllowRemoveAll = true; FileHandler::FetchColorData(m_ColorData); #ifdef GTASA + m_CustomizeData.m_bAllowRemoveAll = true; FileHandler::FetchHandlingID(m_VehicleIDE); Events::processScriptsEvent += [this] diff --git a/src/custom/vehcustmzr.h b/src/custom/vehcustmzr.h index 8350b34..b167dcd 100644 --- a/src/custom/vehcustmzr.h +++ b/src/custom/vehcustmzr.h @@ -8,8 +8,11 @@ class VehCustmzrMgr : public IFeature { private: +#ifdef GTASA ResourceStore m_TuneData { "components", eResourceType::TYPE_IMAGE_TEXT, ImVec2(100, 80) }; ResourceStore m_CustomizeData { "customizations", eResourceType::TYPE_TEXT }; +#endif + std::vector> m_ColorData; // vehicle color data from carcols.dat std::map m_VehicleIDE; char m_nLabel[32] {"Untitled"}; diff --git a/src/dllmain.cpp b/src/dllmain.cpp index d989f8c..18c24f5 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -4,9 +4,13 @@ LONG WINAPI CrashHandler(PEXCEPTION_POINTERS pInfo) { - Log::Print(""); - Log::Print("Unhandled exception at {} (0x{:x})", - pInfo->ExceptionRecord->ExceptionAddress, pInfo->ExceptionRecord->ExceptionCode); + DWORD code = pInfo->ExceptionRecord->ExceptionCode; + if (code > 0x80000000) + { + Log::Print(""); + Log::Print("Unhandled exception at {} (0x{:x})", pInfo->ExceptionRecord->ExceptionAddress, code); + } + return EXCEPTION_CONTINUE_SEARCH; } diff --git a/src/pch.cpp b/src/pch.cpp index 148a2d9..e8d058d 100644 --- a/src/pch.cpp +++ b/src/pch.cpp @@ -2,7 +2,9 @@ eRenderer gRenderer = eRenderer::Unknown; DataStore gConfig = DataStore(FILE_NAME, true); +#ifdef GTASA ResourceStore gTextureList { "misc", eResourceType::TYPE_IMAGE, ImVec2(100, 80) }; +#endif Hotkey aimSkinChanger {VK_RETURN, VK_RETURN, "AimSkinChanger"}; Hotkey freeCam {VK_F6, VK_F6, "Freecam.Toggle"}; Hotkey freeCamForward {VK_KEY_I, VK_KEY_I, "Freecam.Forward"};; diff --git a/src/pch.h b/src/pch.h index 77bd642..883287c 100644 --- a/src/pch.h +++ b/src/pch.h @@ -111,4 +111,7 @@ extern Hotkey teleportMarker; extern Hotkey vehEngine; extern Hotkey vehInstantStart; extern Hotkey vehInstantStop; -extern ResourceStore gTextureList; \ No newline at end of file + +#ifdef GTASA +extern ResourceStore gTextureList; +#endif \ No newline at end of file diff --git a/src/utils/widget.cpp b/src/utils/widget.cpp index 9c94b38..abc9c71 100644 --- a/src/utils/widget.cpp +++ b/src/utils/widget.cpp @@ -273,7 +273,7 @@ static bool RoundedImageButton(ImTextureID textureID, ImVec2& size, const char* void DrawClippedImages(ResourceStore& data, ImVec2 imgSz, size_t imagesInRow, bool showImages, bool favourites, fArg1_t clickFunc, fRtnArg1_t getNameFunc, fRtnBoolArg1_t verifyFunc) { - static IDirect3DTexture9 **pDefaultTex = gTextureList.FindTextureByName("placeholder"); + static IDirect3DTexture9 **pDefaultTex = BY_GAME(gTextureList.FindTextureByName("placeholder"), nullptr, nullptr); ImGuiStyle &style = ImGui::GetStyle(); // Category box