#pragma once
#include "registry.qh"
+#include "self.qh"
#include "sort.qh"
#include "yenc.qh"
const int MSG_ENTITY = 5;
.int SendFlags;
+ .bool(entity this, int sendflags) SendEntity;
IntrusiveList g_uncustomizables;
STATIC_INIT(g_uncustomizables) { g_uncustomizables = IL_NEW(); }
+ .bool(entity this, entity to, int sendflags) net_sendentity;
+
+ bool Net_SendEntity(entity to, int sendflags)
+ {
+ ENGINE_EVENT();
+ return this.net_sendentity(this, to, sendflags);
+ }
+
void Net_LinkEntity(entity e, bool docull, bool checkmodel, float dt, bool(entity this, entity to, int sendflags) sendfunc)
{
if (e.classname == "")
setsize(e, mi, ma);
}
- setSendEntity(e, sendfunc);
+ e.net_sendentity = sendfunc;
+ e.SendEntity = Net_SendEntity;
e.SendFlags = 0xFFFFFF;
if (!docull) e.effects |= EF_NODEPTHTEST;
void Net_UnlinkEntity(entity e)
{
- setSendEntity(e, func_null);
+ e.net_sendentity = func_null;
+ e.SendEntity = func_null;
}
.void(entity this) uncustomizeentityforclient;
SELFWRAP(camera_transform, vector, (vector org, vector ang), (entity this, vector org, vector ang), (this, org, ang))
#define setcamera_transform(e, f) SELFWRAP_SET(camera_transform, e, f)
+// NOTE: still references self via ENGINE_EVENT
+#if 0
/** return false to remove from the client */
SELFWRAP(SendEntity, bool, (entity to, int sendflags), (entity this, entity to, int sendflags), (this, to, sendflags))
#define setSendEntity(e, f) SELFWRAP_SET(SendEntity, e, f)
#define getSendEntity(e) SELFWRAP_GET(SendEntity, e)
+#endif
#define ChangeYaw(e, ...) (__self = (e), builtin_ChangeYaw(__VA_ARGS__))
#define checkclient(e, ...) (__self = (e), builtin_checkclient(__VA_ARGS__))