Skip to content

Commit 9367c99

Browse files
committed
Add for client side too
1 parent 500b07d commit 9367c99

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ bool CStaticFunctionDefinitions::TriggerServerEvent(const char* szName, CClientE
193193
return false;
194194
}
195195

196-
bool CStaticFunctionDefinitions::TriggerLatentServerEvent(const char* szName, CClientEntity& CallWithEntity, CLuaArguments& Arguments, int iBandwidth,
196+
uint CStaticFunctionDefinitions::TriggerLatentServerEvent(const char* szName, CClientEntity& CallWithEntity, CLuaArguments& Arguments, int iBandwidth,
197197
CLuaMain* pLuaMain, ushort usResourceNetId)
198198
{
199199
assert(szName);
@@ -214,11 +214,11 @@ bool CStaticFunctionDefinitions::TriggerLatentServerEvent(const char* szName, CC
214214
return false;
215215
}
216216
g_pClientGame->GetLatentTransferManager()->AddSendBatchBegin(PACKET_ID_LUA_EVENT, pBitStream);
217-
g_pClientGame->GetLatentTransferManager()->AddSend(0, pBitStream->Version(), iBandwidth, pLuaMain, usResourceNetId);
217+
SSendHandle handle = g_pClientGame->GetLatentTransferManager()->AddSend(0, pBitStream->Version(), iBandwidth, pLuaMain, usResourceNetId);
218218
g_pClientGame->GetLatentTransferManager()->AddSendBatchEnd();
219219
g_pNet->DeallocateNetBitStream(pBitStream);
220220

221-
return true;
221+
return handle;
222222
}
223223

224224
return false;

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CStaticFunctionDefinitions
3333
static bool RemoveEventHandler(CLuaMain& LuaMain, const char* szName, CClientEntity& Entity, const CLuaFunctionRef& iLuaFunction);
3434
static bool TriggerEvent(const char* szName, CClientEntity& Entity, const CLuaArguments& Arguments, bool& bWasCancelled);
3535
static bool TriggerServerEvent(const char* szName, CClientEntity& CallWithEntity, CLuaArguments& Arguments);
36-
static bool TriggerLatentServerEvent(const char* szName, CClientEntity& CallWithEntity, CLuaArguments& Arguments, int bandwidth, CLuaMain* pLuaMain,
36+
static uint TriggerLatentServerEvent(const char* szName, CClientEntity& CallWithEntity, CLuaArguments& Arguments, int bandwidth, CLuaMain* pLuaMain,
3737
ushort usResourceNetId);
3838
static bool CancelEvent(bool bCancel);
3939
static bool WasEventCancelled();

Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.Event.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ int CLuaFunctionDefs::TriggerLatentServerEvent(lua_State* luaVM)
323323
}
324324

325325
// Trigger it
326-
if (CStaticFunctionDefinitions::TriggerLatentServerEvent(strName, *pCallWithEntity, Arguments, iBandwidth, pLuaMain, usResourceNetId))
326+
SSendHandle eventID = CStaticFunctionDefinitions::TriggerLatentServerEvent(strName, *pCallWithEntity, Arguments, iBandwidth, pLuaMain, usResourceNetId);
327+
if (eventID >= 0)
327328
{
328-
lua_pushboolean(luaVM, true);
329+
lua_pushnumber(luaVM, eventID);
329330
return 1;
330331
}
331332
}

0 commit comments

Comments
 (0)