From 9fb608fc715185a633e5e064daa143569ab815ab Mon Sep 17 00:00:00 2001 From: Mohab <133429578+MohabCodeX@users.noreply.github.com> Date: Thu, 14 Aug 2025 21:40:41 +0300 Subject: [PATCH 1/2] Fix garage size calculation by adjusting height based on garage position --- Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp | 5 +++++ Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index e9b947f0af..659baf8891 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -6676,6 +6676,11 @@ bool CStaticFunctionDefinitions::GetGarageSize(unsigned char ucGarageID, float& if (pGarage) { pGarage->GetSize(fHeight, fWidth, fDepth); + + CVector vecPosition; + pGarage->GetPosition(vecPosition); + fHeight = fHeight - vecPosition.fZ; + return true; } diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp index caa53e4c67..13084cd7a7 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp @@ -678,9 +678,9 @@ int CLuaWorldDefs::GetGarageSize(lua_State* luaVM) if (CStaticFunctionDefinitions::GetGarageSize(iGarageID, fHeight, fWidth, fDepth)) { - lua_pushnumber(luaVM, fHeight); lua_pushnumber(luaVM, fWidth); lua_pushnumber(luaVM, fDepth); + lua_pushnumber(luaVM, fHeight); return 3; } } From 5a60a6ea5b57d57941a7306084e4c8025be07025 Mon Sep 17 00:00:00 2001 From: Mohab Date: Fri, 15 Aug 2025 21:50:45 +0300 Subject: [PATCH 2/2] compound assignment operator --- Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 659baf8891..9e8bf4e3e2 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -6679,7 +6679,7 @@ bool CStaticFunctionDefinitions::GetGarageSize(unsigned char ucGarageID, float& CVector vecPosition; pGarage->GetPosition(vecPosition); - fHeight = fHeight - vecPosition.fZ; + fHeight -= vecPosition.fZ; return true; }