Skip to content

Commit 67d0f46

Browse files
committed
1 parent 71efd41 commit 67d0f46

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/core/modules/entities/entities_props.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ BoostSendVarProxyFn SendPropSharedExt::get_proxy_function(SendProp *pSendProp)
147147
return BoostSendVarProxyFn(pSendProp->GetProxyFn());
148148
}
149149

150+
BoostDataTableProxyFn SendPropSharedExt::get_data_table_proxy_function(SendProp *pSendProp)
151+
{
152+
if (pSendProp->IsExcludeProp())
153+
BOOST_RAISE_EXCEPTION(PyExc_TypeError, "%s is excluded.", pSendProp->GetName());
154+
155+
if (pSendProp->GetType() != DPT_DataTable)
156+
BOOST_RAISE_EXCEPTION(PyExc_TypeError, "%s is not a DataTable.", pSendProp->GetName());
157+
158+
return BoostDataTableProxyFn(pSendProp->GetDataTableProxyFn());
159+
}
160+
150161

151162
// ============================================================================
152163
// >> SendPropVariantExt

src/core/modules/entities/entities_props.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
// typedefs
4242
//-----------------------------------------------------------------------------
4343
BOOST_FUNCTION_TYPEDEF(void (const SendProp*, const void*, const void*, DVariant*, int, int), BoostSendVarProxyFn)
44+
BOOST_FUNCTION_TYPEDEF(void* (const SendProp*, const void*, const void*, CSendProxyRecipients*, int), BoostDataTableProxyFn)
4445

4546

4647
//-----------------------------------------------------------------------------
@@ -67,6 +68,7 @@ class SendPropSharedExt
6768
{
6869
public:
6970
static BoostSendVarProxyFn get_proxy_function(SendProp *pSendProp);
71+
static BoostDataTableProxyFn get_data_table_proxy_function(SendProp *pSendProp);
7072
};
7173

7274

src/core/modules/entities/entities_props_wrap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ void export_send_prop(scope _props)
142142
);
143143

144144
SendProp_.add_property("offset", &SendProp::GetOffset);
145+
146+
// TODO: Rename proxy_function to send_var_proxy_function
145147
SendProp_.add_property("proxy_function", &SendPropSharedExt::get_proxy_function);
148+
SendProp_.add_property("data_table_proxy_function", &SendPropSharedExt::get_data_table_proxy_function);
146149

147150
// CS:GO specific properties...
148151
SendProp_.NOT_IMPLEMENTED_ATTR("priority");

0 commit comments

Comments
 (0)