self.enttype = t;
switch(t)
{
+ case ENT_CLIENT_MUTATOR: {
+ int mutID = ReadMutator();
+ if (!MUTATOR_CALLHOOK(CSQC_Ent_Update, mutID, bIsNewEntity))
+ error(sprintf("Unknown mutator type in CSQC_Ent_Update (mutID: %d, edict: %d, classname: %s)\n", mutID, num_for_edict(self), self.classname));
+ break;
+ }
case ENT_CLIENT_ENTCS: Ent_ReadEntCS(); break;
case ENT_CLIENT_SCORES: Ent_ReadPlayerScore(); break;
case ENT_CLIENT_TEAMSCORES: Ent_ReadTeamScore(); break;
case ENT_CLIENT_LASER: Ent_Laser(); break;
case ENT_CLIENT_NAGGER: Ent_Nagger(); break;
case ENT_CLIENT_ELIMINATEDPLAYERS: Ent_EliminatedPlayers(); break;
- case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break;
case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break;
case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
case ENT_CLIENT_GIBSPLASH: Ent_GibSplash(bIsNewEntity); break;
* NOTE: return true if you handled the command, return false to continue handling
*/
#define EV_CSQC_Parse_TempEntity(i, o) \
- /** entity id */ i(int, mutator_argv_int_0) \
+ /** mutator id */ i(int, mutator_argv_int_0) \
/**/
MUTATOR_HOOKABLE(CSQC_Parse_TempEntity, EV_CSQC_Parse_TempEntity);
+/**
+ * Called when a shared entity is updated
+ * NOTE: hooks MUST start with `if (MUTATOR_RETURNVALUE) return false;`
+ * NOTE: hooks MUST start with `if (!ReadMutatorEquals(mutator_argv_int_0, name_of_mutator)) return false;`
+ * NOTE: return true if you handled the command, return false to continue handling
+ */
+#define EV_CSQC_Ent_Update(i, o) \
+ /** mutator id */ i(int, mutator_argv_int_0) \
+ /** bIsNewEntity */ i(bool, mutator_argv_bool_0) \
+ /**/
+MUTATOR_HOOKABLE(CSQC_Ent_Update, EV_CSQC_Ent_Update);
+
/** Called when a projectile is linked with CSQC */
#define EV_Ent_Projectile(i, o) \
/** entity id */ i(entity, self) \
strunzone(self.netname3);
}
+/** flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] */
void Ent_WaypointSprite()
{
int sendflags, f, t;
const int ENT_CLIENT_RAINSNOW = 7;
const int ENT_CLIENT_LASER = 8;
const int ENT_CLIENT_NAGGER = 9; // flags [votecalledvote]
-const int ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable]
const int ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor]
const int ENT_CLIENT_PROJECTILE = 12;
const int ENT_CLIENT_GIBSPLASH = 13;
const int ENT_CLIENT_HEALING_ORB = 80;
+const int ENT_CLIENT_MUTATOR = TE_CSQC_MUTATOR; // 99
+
const int SPRITERULE_DEFAULT = 0;
const int SPRITERULE_TEAMPLAY = 1;
const int SPRITERULE_SPECTATOR = 2;
#include "mutator/damagetext.qc"
#include "mutator/itemstime.qc"
+#include "mutator/waypointsprites.qc"
--- /dev/null
+REGISTER_MUTATOR(waypointsprites, true);
+
+#ifdef CSQC
+void Ent_WaypointSprite();
+MUTATOR_HOOKFUNCTION(waypointsprites, CSQC_Ent_Update) {
+ if (MUTATOR_RETURNVALUE) return false;
+ if (!ReadMutatorEquals(mutator_argv_int_0, waypointsprites)) return false;
+ Ent_WaypointSprite();
+ return true;
+}
+#endif
{
float dt;
- WriteByte(MSG_ENTITY, ENT_CLIENT_WAYPOINT);
+ WriteMutator(MSG_ENTITY, waypointsprites);
sendflags = sendflags & 0x7F;