#define REGISTER_NET_LINKED(id) \
[[accumulate]] NET_HANDLE(id, bool isnew) \
{ \
- this = self; \
+ this = __self; \
this.sourceLoc = __FILE__ ":" STR(__LINE__); \
if (!this) isnew = true; \
} \
.int Version; // deprecated, use SendFlags
.int SendFlags;
- .bool(entity to, int sendflags) SendEntity;
- /** return false to remove from the client */
- .bool(entity this, entity to, int sendflags) SendEntity3;
-
- bool SendEntity_self(entity to, int sendflags) { SELFPARAM(); return this.SendEntity3(this, to, sendflags); }
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
{
setsize(e, mi, ma);
}
- e.SendEntity = SendEntity_self;
- e.SendEntity3 = sendfunc;
+ setSendEntity(e, sendfunc);
e.SendFlags = 0xFFFFFF;
if (!docull) e.effects |= EF_NODEPTHTEST;
if (dt)
{
e.nextthink = time + dt;
- e.think = SUB_Remove_self;
+ setthink(e, SUB_Remove);
}
}
void Net_UnlinkEntity(entity e)
{
- e.SendEntity = func_null;
+ setSendEntity(e, func_null);
}
- .void() uncustomizeentityforclient;
+ .void(entity this) uncustomizeentityforclient;
.float uncustomizeentityforclient_set;
- void SetCustomizer(entity e, float() customizer, void() uncustomizer)
+ void SetCustomizer(entity e, bool(entity this) customizer, void(entity this) uncustomizer)
{
- e.customizeentityforclient = customizer;
+ setcefc(e, customizer);
e.uncustomizeentityforclient = uncustomizer;
e.uncustomizeentityforclient_set = !!uncustomizer;
}
void UncustomizeEntitiesRun()
{
- SELFPARAM();
- FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITH(entity, self, it, it.uncustomizeentityforclient()));
+ FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, it.uncustomizeentityforclient(it));
}
STRING_ITERATOR(g_buf, string_null, 0);