Skip to content

Commit

Permalink
Fix getObjectPropertiesGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Jun 15, 2024
1 parent eb856da commit bff8ca8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Client/game_sa/CModelInfoSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1992,11 +1992,7 @@ void CModelInfoSA::SetObjectPropertiesGroup(unsigned short usNewGroup)

unsigned short CModelInfoSA::GetObjectPropertiesGroup()
{
unsigned short usGroup = GetInterface()->usDynamicIndex;
if (usGroup == 0xFFFF)
usGroup = 0;

return usGroup;
return GetInterface()->usDynamicIndex;
}

void CModelInfoSA::RestoreObjectPropertiesGroup()
Expand Down
3 changes: 2 additions & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,8 @@ int CLuaEngineDefs::EngineGetModelPhysicalPropertiesGroup(lua_State* luaVM)
auto pModelInfo = g_pGame->GetModelInfo(iModelID);
if (pModelInfo)
{
lua_pushnumber(luaVM, pModelInfo->GetObjectPropertiesGroup());
uint16_t groupId = pModelInfo->GetObjectPropertiesGroup();
lua_pushnumber(luaVM, groupId == 0xFFFF ? -1 : groupId);
return 1;
}
argStream.SetCustomError("Expected valid model ID at argument 1");
Expand Down

0 comments on commit bff8ca8

Please sign in to comment.