3#define WEPENT_SET_NORMAL(var, x) MACRO_BEGIN \
8#define WEPENT_NETPROPS(PROP) PROP(false, sv_entnum, WEPENT_SET_NORMAL, {}, {}) \
9 PROP(false, m_switchweapon, WEPENT_SET_NORMAL, \
10 { WriteByte(chan, this.m_switchweapon.m_id); }, \
11 { (viewmodels[this.m_wepent_slot]).switchweapon = REGISTRY_GET(Weapons, ReadByte()); }) \
13 PROP(false, m_switchingweapon, WEPENT_SET_NORMAL, \
14 { WriteByte(chan, this.m_switchingweapon.m_id); }, \
15 { (viewmodels[this.m_wepent_slot]).switchingweapon = REGISTRY_GET(Weapons, ReadByte()); }) \
17 PROP(false, m_weapon, WEPENT_SET_NORMAL, \
18 { WriteByte(chan, this.m_weapon.m_id); }, \
19 { (viewmodels[this.m_wepent_slot]).activeweapon = REGISTRY_GET(Weapons, ReadByte()); }) \
21 PROP(false, m_alpha, WEPENT_SET_NORMAL, \
22 { WriteByte(chan, rint(bound(-1, 254 * this.m_alpha, 254) - -1)); }, \
23 { (viewmodels[this.m_wepent_slot]).m_alpha = (ReadByte() + -1) / 254; }) \
25 PROP(false, vortex_charge, WEPENT_SET_NORMAL, \
26 { WriteByte(chan, this.vortex_charge * 255); }, \
27 { (viewmodels[this.m_wepent_slot]).vortex_charge = ReadByte() / 255; }) \
29 PROP(false, oknex_charge, WEPENT_SET_NORMAL, \
30 { WriteByte(chan, this.oknex_charge * 16); }, \
31 { (viewmodels[this.m_wepent_slot]).oknex_charge = ReadByte() / 16; }) \
33 PROP(false, m_gunalign, WEPENT_SET_NORMAL, \
34 { WriteByte(chan, this.m_gunalign); }, \
35 { (viewmodels[this.m_wepent_slot]).m_gunalign = ReadByte(); }) \
37 PROP(false, porto_v_angle_held, WEPENT_SET_NORMAL, \
38 { WriteByte(chan, this.porto_v_angle_held); if(this.porto_v_angle_held) { \
39 WriteAngleVector2D(chan, this.owner.porto_v_angle); \
41 { (viewmodels[this.m_wepent_slot]).angles_held_status = ReadByte(); if((viewmodels[this.m_wepent_slot]).angles_held_status) { \
42 (viewmodels[this.m_wepent_slot]).angles_held = ReadAngleVector2D(); } \
43 else { (viewmodels[this.m_wepent_slot]).angles_held = '0 0 0'; } }) \
45 PROP(false, tuba_instrument, WEPENT_SET_NORMAL, \
46 { WriteByte(chan, this.tuba_instrument); }, \
47 { (viewmodels[this.m_wepent_slot]).tuba_instrument = ReadByte(); }) \
49 PROP(false, hagar_load, WEPENT_SET_NORMAL, \
50 { WriteByte(chan, this.hagar_load); }, \
51 { (viewmodels[this.m_wepent_slot]).hagar_load = ReadByte(); }) \
53 PROP(false, minelayer_mines, WEPENT_SET_NORMAL, \
54 { WriteByte(chan, this.minelayer_mines); }, \
55 { (viewmodels[this.m_wepent_slot]).minelayer_mines = ReadByte(); }) \
57 PROP(false, arc_heat_percent, WEPENT_SET_NORMAL, \
58 { WriteByte(chan, this.arc_heat_percent * 255); }, \
59 { (viewmodels[this.m_wepent_slot]).arc_heat_percent = ReadByte() / 255; }) \
61 PROP(false, vortex_chargepool_ammo, WEPENT_SET_NORMAL, \
62 { WriteByte(chan, this.vortex_chargepool_ammo * 16); }, \
63 { (viewmodels[this.m_wepent_slot]).vortex_chargepool_ammo = ReadByte() / 16; }) \
65 PROP(false, oknex_chargepool_ammo, WEPENT_SET_NORMAL, \
66 { WriteByte(chan, this.oknex_chargepool_ammo * 16); }, \
67 { (viewmodels[this.m_wepent_slot]).oknex_chargepool_ammo = ReadByte() / 16; }) \
69 PROP(false, clip_load, WEPENT_SET_NORMAL, \
70 { WriteShort(chan, this.clip_load); }, \
71 { (viewmodels[this.m_wepent_slot]).clip_load = ReadShort(); }) \
73 PROP(false, clip_size, WEPENT_SET_NORMAL, \
74 { WriteShort(chan, this.clip_size); }, \
75 { (viewmodels[this.m_wepent_slot]).clip_size = ReadShort(); }) \
77 PROP(false, skin, WEPENT_SET_NORMAL, \
78 { WriteShort(chan, this.skin); }, \
79 { (viewmodels[this.m_wepent_slot]).m_skin = ReadShort(); }) \
89 #define X(public, fld, set, sv, cl) { \
91 WEPENT_PUBLICMASK |= BIT(i); \
97 if (i >=
BITS(24 - 1))
LOG_FATAL(
"Exceeded WEPENT_NETPROPS limit");
108 .entity weaponentity = this.
owner.weaponentity_fld;
110 WriteInt24_t(chan, sf);
112 #define X(public, fld, set, sv, cl) { \
141 #define X(public, fld, set, sv, cl) { \
142 if (this.fld != o.fld) { \
143 set(this.fld, o.fld); \
144 this.SendFlags |= BIT(i); \
155 .entity weaponentity = this.
owner.weaponentity_fld;
156 return e.(weaponentity) == this.
owner;
181 #define X(public, fld, set, sv, cl) { \
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define STATIC_INIT(func)
during worldspawn
entity viewmodels[MAX_WEAPONSLOTS]
entity WaypointSprite_getviewentity(entity e)
int weaponslot(.entity weaponentity)
void wepent_think(entity this)
bool wepent_send(entity this, entity to, int sf)
bool ReadWepent(entity this)
#define WEPENT_NETPROPS(PROP)
void wepent_link(entity wep)
bool wepent_customize(entity this, entity client)
bool _wepent_send(entity this, entity to, int sf, int chan)