2022-11-19 01:49:36 +00:00
|
|
|
#include "hooking.hpp"
|
2023-07-14 09:02:47 +00:00
|
|
|
#include "services/players/player_service.hpp"
|
2022-11-19 01:49:36 +00:00
|
|
|
#include "util/notify.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
bool hooks::received_clone_create(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, int32_t object_id, int32_t object_flag, rage::datBitBuffer* buffer, int32_t timestamp)
|
|
|
|
{
|
|
|
|
if (object_type < eNetObjType::NET_OBJ_TYPE_AUTOMOBILE || object_type > eNetObjType::NET_OBJ_TYPE_TRAIN)
|
|
|
|
{
|
|
|
|
notify::crash_blocked(src, "out of bounds object type");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-07-14 09:02:47 +00:00
|
|
|
auto plyr = g_player_service->get_by_id(src->m_player_id);
|
|
|
|
|
|
|
|
if (plyr && plyr->block_clone_create)
|
|
|
|
return true;
|
|
|
|
|
2022-12-18 23:15:52 +01:00
|
|
|
g.m_syncing_player = src;
|
2022-11-19 01:49:36 +00:00
|
|
|
return g_hooking->get_original<hooks::received_clone_create>()(mgr, src, dst, object_type, object_id, object_flag, buffer, timestamp);
|
|
|
|
}
|
|
|
|
}
|