Skip to content

Commit edc9180

Browse files
committed
Return nil on errors
1 parent f7d9e41 commit edc9180

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,18 +1710,14 @@ int CLuaPedDefs::SetPedFightingStyle(lua_State* luaVM)
17101710
argStream.ReadUserData(pEntity);
17111711
argStream.ReadNumber(ucStyle);
17121712

1713-
if (!argStream.HasErrors())
1713+
if (argStream.HasErrors())
17141714
{
1715-
if (CStaticFunctionDefinitions::SetPedFightingStyle(*pEntity, ucStyle))
1716-
{
1717-
lua_pushboolean(luaVM, true);
1718-
return 1;
1719-
}
1720-
}
1721-
else
17221715
m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage());
1716+
lua_pushnil(luaVM);
1717+
return 1;
1718+
}
17231719

1724-
lua_pushboolean(luaVM, false);
1720+
lua_pushboolean(luaVM, CStaticFunctionDefinitions::SetPedFightingStyle(*pEntity, ucStyle));
17251721
return 1;
17261722
}
17271723

0 commit comments

Comments
 (0)