#endif
#ifdef SVQC
-bool Net_Write_Effect(entity client, int sf)
-{SELFPARAM();
+bool Net_Write_Effect(entity this, entity client, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT);
(EFFECT_COUNT >= 255)
? WriteShort(MSG_ENTITY, self.m_id)
#endif
#ifdef SVQC
-bool Inventory_Send(entity to, int sf)
-{SELFPARAM();
+bool Inventory_Send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_INVENTORY);
entity e = self.owner;
if (IS_SPEC(e)) e = e.enemy;
// Send an entity to a client
// only use on minigame entities or entities with a minigame owner
-bool minigame_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool minigame_SendEntity(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_MINIGAME);
WriteByte(MSG_ENTITY, sf);
entity minigame_sessions;
-bool minigame_SendEntity(entity to, int sf);
+bool minigame_SendEntity(entity this, entity to, int sf);
void RegisterMinigames();
const int MINIGAMES_MAX = 24;
#ifdef SVQC
/** flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] */
-float WaypointSprite_SendEntity(entity to, float sendflags)
-{SELFPARAM();
+bool WaypointSprite_SendEntity(entity this, entity to, float sendflags)
+{
WriteMutator(MSG_ENTITY, waypointsprites);
sendflags = sendflags & 0x7F;
return self.waypointsprite_visible_for_player(e);
}
-float WaypointSprite_SendEntity(entity to, float sendflags);
+bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
void WaypointSprite_Reset()
{SELFPARAM();
float WaypointSprite_Customize();
-float WaypointSprite_SendEntity(entity to, float sendflags);
+bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
void WaypointSprite_Reset();
#endif
#ifdef SVQC
-bool healer_send(entity to, int sf)
+bool healer_send(entity this, entity to, int sf)
{
- SELFPARAM();
int channel = MSG_ENTITY;
WriteHeader(channel, Nade_Heal);
WriteByte(channel, sf);
REGISTER_NADE(Null);
#ifdef SVQC
-float healer_send(entity to, int sf);
+bool healer_send(entity this, entity to, int sf);
#endif
entity Nade_FromProjectile(float proj)
remove(self);
}
-float Net_Write_Notification(entity client, int sf)
-{SELFPARAM();
+bool Net_Write_Notification(entity this, entity client, int sf)
+{
if(Notification_ShouldSend(self.nent_broadcast, client, self.nent_client))
{
WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
self.SendFlags |= 2;
}
-bool conveyor_send(entity to, int sf)
-{SELFPARAM();
+bool conveyor_send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_CONVEYOR);
WriteByte(MSG_ENTITY, sf);
}
#ifdef SVQC
-float func_ladder_send(entity to, float sf)
-{SELFPARAM();
+bool func_ladder_send(entity this, entity to, float sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_LADDER);
WriteString(MSG_ENTITY, self.classname);
#ifdef SVQC
// NOTE: also contains func_sparks
-float pointparticles_SendEntity(entity to, float fl)
-{SELFPARAM();
+bool pointparticles_SendEntity(entity this, entity to, float fl)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_POINTPARTICLES);
// optional features to save space
#ifdef SVQC
-float rainsnow_SendEntity(entity to, float sf)
-{SELFPARAM();
+bool rainsnow_SendEntity(entity this, entity to, float sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
WriteByte(MSG_ENTITY, self.state);
WriteCoord(MSG_ENTITY, self.origin_x + self.mins_x);
WriteShort(MSG_ENTITY, compressShortVector(self.dest));
WriteShort(MSG_ENTITY, self.count);
WriteByte(MSG_ENTITY, self.cnt);
- return 1;
+ return true;
}
/*QUAKED spawnfunc_func_rain (0 .5 .8) ?
}
}
-float laser_SendEntity(entity to, float fl)
-{SELFPARAM();
+bool laser_SendEntity(entity this, entity to, float fl)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_LASER);
fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
if(self.spawnflags & 2)
// spawnflags:
// 1 = START_OFF
// when triggered, it is disabled/enabled for everyone
-float trigger_music_SendEntity(entity to, float sf)
-{SELFPARAM();
+bool trigger_music_SendEntity(entity this, entity to, float sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_TRIGGER_MUSIC);
sf &= ~0x80;
if(self.cnt)
}
-float target_push_send(entity to, float sf)
-{SELFPARAM();
+bool target_push_send(entity this, entity to, float sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_TARGET_PUSH);
WriteByte(MSG_ENTITY, self.cnt);
self.nextthink = time;
}
-bool trigger_viewloc_send(entity to, int sf)
-{SELFPARAM();
+bool trigger_viewloc_send(entity this, entity to, int sf)
+{
// CSQC doesn't need to know our origin (yet), as we're only available for referencing
WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC_TRIGGER);
InitializeEntity(self, viewloc_init, INITPRIO_FINDTARGET);
}
-bool viewloc_send(entity to, int sf)
-{SELFPARAM();
+bool viewloc_send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC);
WriteByte(MSG_ENTITY, self.cnt);
}
-float turret_send(entity to, float sf)
-{SELFPARAM();
+bool turret_send(entity this, entity to, float sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET);
WriteByte(MSG_ENTITY, sf);
}
#endif
-bool SendAuxiliaryXhair(entity to, int sf)
-{SELFPARAM();
+bool SendAuxiliaryXhair(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
float autocvar_g_vehicle_bumblebee_cannon_spread;
float autocvar_g_vehicle_bumblebee_cannon_force;
-float bumble_raygun_send(entity to, int sf);
+bool bumble_raygun_send(entity this, entity to, int sf);
void bumblebee_fire_cannon(entity _gun, string _tagname, entity _owner)
{
DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
}
-float bumble_raygun_send(entity to, float sf)
-{SELFPARAM();
+bool bumble_raygun_send(entity this, entity to, float sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_BUMBLE_RAYGUN);
WriteByte(MSG_ENTITY, sf);
#ifdef SVQC
spawnfunc(weapon_arc) { weapon_defaultspawnfunc(WEP_ARC.m_id); }
-float W_Arc_Beam_Send(entity to, int sf)
-{SELFPARAM();
+bool W_Arc_Beam_Send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_ARC_BEAM);
// Truncate information when this beam is displayed to the owner client
return note;
}
-bool W_Tuba_NoteSendEntity(entity to, int sf)
-{SELFPARAM();
+bool W_Tuba_NoteSendEntity(entity this, entity to, int sf)
+{
int f;
msg_entity = to;
#define NET_H
#ifdef SVQC
+.int Version; // deprecated, use SendFlags
.int SendFlags;
.bool(entity to, int sendflags) SendEntity;
+.bool(entity this, entity to, int sendflags) SendEntity3;
-void Net_LinkEntity(entity e, bool docull, float dt, bool(entity to, int sendflags) sendfunc)
+bool SendEntity_self(entity to, int sendflags) { return self.SendEntity3(self, to, sendflags); }
+
+void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
{
if (!e.classname) e.classname = "net_linked";
setsize(e, mi, ma);
}
- e.SendEntity = sendfunc;
+ e.SendEntity = SendEntity_self;
+ e.SendEntity3 = sendfunc;
e.SendFlags = 0xFFFFFF;
if (!docull) e.effects |= EF_NODEPTHTEST;
WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
}
-float ClientData_Send(entity to, int sf)
-{SELFPARAM();
+bool ClientData_Send(entity this, entity to, int sf)
+{
if(to != self.owner)
{
error("wtf");
.float ebouncefactor, ebouncestop; // electro's values
// TODO do we need all these fields, or should we stop autodetecting runtime
// changes and just have a console command to update this?
-float ClientInit_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool ClientInit_SendEntity(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_INIT);
WriteByte(MSG_ENTITY, g_nexball_meter_period * 32);
WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[0]));
// =============================================
// Nagger for players to know status of voting
-float Nagger_SendEntity(entity to, float sendflags)
+bool Nagger_SendEntity(entity this, entity to, float sendflags)
{
int nags, i, f, b;
entity e;
#include "controlpoint.qh"
-bool cpicon_send(entity to, int sf)
-{SELFPARAM();
+bool cpicon_send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_CONTROLPOINT_ICON);
WriteByte(MSG_ENTITY, sf);
if(sf & CPSF_SETUP)
float next_pingtime;
-.float Version;
-
// player sounds, voice messages
// TODO implemented fall and falling
#define ALLPLAYERSOUNDS \
return true;
}
-float entcs_send(entity to, int sf)
-{SELFPARAM();
+bool entcs_send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
WriteByte(MSG_ENTITY, sf);
if(sf & 1)
float entcs_customize();
-float entcs_send(entity to, int sf);
+bool entcs_send(entity this, entity to, int sf);
void entcs_think();
#include "../csqcmodellib/sv_model.qh"
#include "../warpzonelib/common.qh"
-float Damage_DamageInfo_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
WriteShort(MSG_ENTITY, self.projectiledeathtype);
WriteCoord(MSG_ENTITY, floor(self.origin.x));
.float dmg_force;
.float dmg_radius;
-float Damage_DamageInfo_SendEntity(entity to, int sf);
+bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf);
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner);
}
.vector hook_start, hook_end;
-float GrapplingHookSend(entity to, int sf)
-{SELFPARAM();
+bool GrapplingHookSend(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_HOOK);
sf = sf & 0x7F;
if(sound_allowed(MSG_BROADCAST, self.realowner))
self.SendFlags |= 2;
}
-float g_clientmodel_genericsendentity (entity to, int sf)
-{SELFPARAM();
+bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
+{
sf = sf & 0x0F;
if(self.angles != '0 0 0')
sf |= 0x10;
#include "g_violence.qh"
#include "_all.qh"
-float Violence_GibSplash_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool Violence_GibSplash_SendEntity(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_GIBSPLASH);
WriteByte(MSG_ENTITY, self.state); // actually type
WriteByte(MSG_ENTITY, bound(1, self.cnt * 16, 255)); // gibbage amount multiplier
#ifndef G_VIOLENCE_H
#define G_VIOLENCE_H
-float Violence_GibSplash_SendEntity(entity to, int sf);
+bool Violence_GibSplash_SendEntity(entity this, entity to, int sf);
// TODO maybe convert this to a TE?
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker);
}
entity randomseed;
-float RandomSeed_Send(entity to, int sf)
-{SELFPARAM();
+bool RandomSeed_Send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
WriteShort(MSG_ENTITY, self.cnt);
return true;
#include "generator.qh"
-bool generator_send(entity to, int sf)
-{SELFPARAM();
+bool generator_send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_GENERATOR);
WriteByte(MSG_ENTITY, sf);
if(sf & GSF_SETUP)
const int GSF_STATUS = 4;
const int GSF_SETUP = 8;
-bool generator_send(entity to, int sf);
+bool generator_send(entity this, entity to, int sf);
#endif
}
}
-float MapVote_SendEntity(entity to, int sf)
+bool MapVote_SendEntity(entity this, entity to, int sf)
{
float i;
}
.float(entity) isEliminated;
-float EliminatedPlayers_SendEntity(entity to, float sendflags)
+bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
{
float i, f, b;
entity e;
.float scale2;
-float modeleffect_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool modeleffect_SendEntity(entity this, entity to, int sf)
+{
float f;
WriteByte(MSG_ENTITY, ENT_CLIENT_MODELEFFECT);
float sound_allowed(float dest, entity e);
void InitializeEntity(entity e, void(void) func, float order);
void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer);
-void Net_LinkEntity(entity e, bool docull, float dt, bool(entity, int) sendfunc);
#endif
// Main Link Functions
// ===================
-bool ons_Link_Send(entity to, int sendflags)
-{SELFPARAM();
+bool ons_Link_Send(entity this, entity to, int sendflags)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_RADARLINK);
WriteByte(MSG_ENTITY, sendflags);
if(sendflags & 1)
* teamscore entities
*/
-float TeamScore_SendEntity(entity to, float sendflags)
-{SELFPARAM();
+bool TeamScore_SendEntity(entity this, entity to, float sendflags)
+{
float i, p, longflags;
WriteByte(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
}
}
-float ScoreInfo_SendEntity(entity to, int sf)
+bool ScoreInfo_SendEntity(entity this, entity to, int sf)
{
float i;
WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
* per-player score entities
*/
-float PlayerScore_SendEntity(entity to, float sendflags)
-{SELFPARAM();
+bool PlayerScore_SendEntity(entity this, entity to, float sendflags)
+{
float i, p, longflags;
WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES);
#include "../common/util.qh"
#include "../warpzonelib/util_server.qh"
-float SpawnPoint_Send(entity to, int sf)
-{SELFPARAM();
+bool SpawnPoint_Send(entity this, entity to, int sf)
+{
WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
WriteByte(MSG_ENTITY, self.team);
return true;
}
-float SpawnEvent_Send(entity to, int sf)
-{SELFPARAM();
+bool SpawnEvent_Send(entity this, entity to, int sf)
+{
float send;
WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
.vector spawnpoint_score;
float spawnpoint_nag;
-float SpawnEvent_Send(entity to, int sf);
+bool SpawnEvent_Send(entity this, entity to, int sf);
entity Spawn_FilterOutBadSpots(entity firstspot, float mindist, float teamcheck);
entity SelectSpawnPoint (float anypoint);
spawnfunc(info_player_deathmatch);
#endif
#ifdef SVQC
-bool ItemSend(entity to, int sf)
-{SELFPARAM();
+bool ItemSend(entity this, entity to, int sf)
+{
if(self.gravity)
sf |= ISF_DROP;
else
spawnfunc(item_rockets);
float autocvar_sv_simple_items;
-bool ItemSend(entity to, int sf);
+bool ItemSend(entity this, entity to, int sf);
float have_pickup_item(void);
// Savage: used for item garbage-collection
// TODO: perhaps nice special effect?
-bool ItemSend(entity to, int sf);
+bool ItemSend(entity this, entity to, int sf);
void ItemUpdate(entity item);
// pickup evaluation functions
return 1 + rint(n * 100.0 / d);
}
-float accuracy_send(entity to, int sf)
-{SELFPARAM();
+bool accuracy_send(entity this, entity to, int sf)
+{
int w, f;
entity a;
WriteByte(MSG_ENTITY, ENT_CLIENT_ACCURACY);
.float csqcprojectile_type;
-bool CSQCProjectile_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
+{
float ft, fr;
// note: flag 0x08 = no trail please (teleport bit)