#define EV_HUD_Draw_overlay(i, o) \
/**/ o(vector, MUTATOR_ARGV_0_vector) \
- /**/ o(float, MUTATOR_ARGV_0_float) \
+ /**/ o(float, MUTATOR_ARGV_1_float) \
/**/
MUTATOR_HOOKABLE(HUD_Draw_overlay, EV_HUD_Draw_overlay);
if(!intermission)
if (MUTATOR_CALLHOOK(HUD_Draw_overlay))
{
- drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, MUTATOR_ARGV(0, vector), autocvar_hud_colorflash_alpha * MUTATOR_ARGV(0, float), DRAWFLAG_ADDITIVE);
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE);
}
else if(STAT(FROZEN))
{
_(x, string) \
/**/
-#define MUTATOR_ARGV(x, type) MUTATOR_ARGV_##x##_##type
+// TODO: migrate to arrays some day when no other globals are used
+#define M_ARGV(x, type) MUTATOR_ARGV_##x##_##type
#define MUTATOR_NEWGLOBAL(x, type) type MUTATOR_ARGV_##x##_##type;
MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 0)
MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 1)
MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 2)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 3)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 4)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 5)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 6)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 7)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 8)
#undef MUTATOR_TYPES
#undef MUTATOR_NEWGLOBAL
#define EV_WP_Format(i, o) \
/**/ i(entity, MUTATOR_ARGV_0_entity) \
- /**/ i(string, MUTATOR_ARGV_0_string) \
- /**/ o(vector, MUTATOR_ARGV_0_vector) \
- /**/ o(string, MUTATOR_ARGV_0_string) \
+ /**/ i(string, MUTATOR_ARGV_1_string) \
+ /**/ o(vector, MUTATOR_ARGV_2_vector) \
+ /**/ o(string, MUTATOR_ARGV_3_string) \
/**/
MUTATOR_HOOKABLE(WP_Format, EV_WP_Format);
}
MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
{
- entity this = MUTATOR_ARGV(0, entity);
- string s = MUTATOR_ARGV(0, string);
+ entity this = M_ARGV(0, entity);
+ string s = M_ARGV(1, string);
if (s == WP_Buff.netname || s == RADARICON_Buff.netname)
{
Buff b = Buffs_from(this.wp_extra);
- MUTATOR_ARGV(0, vector) = b.m_color;
- MUTATOR_ARGV(0, string) = b.m_prettyName;
+ M_ARGV(2, vector) = b.m_color;
+ M_ARGV(3, string) = b.m_prettyName;
return true;
}
}
#define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3 /* all players */)
MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
if (SV_DAMAGETEXT_DISABLED()) return;
- const entity attacker = MUTATOR_ARGV(0, entity);
- const entity hit = MUTATOR_ARGV(1, entity); if (hit == attacker) return;
- const int health = MUTATOR_ARGV(0, int);
- const int armor = MUTATOR_ARGV(1, int);
- const int deathtype = MUTATOR_ARGV(2, int);
+ const entity attacker = M_ARGV(0, entity);
+ const entity hit = M_ARGV(1, entity); if (hit == attacker) return;
+ const int health = M_ARGV(2, int);
+ const int armor = M_ARGV(3, int);
+ const int deathtype = M_ARGV(5, int);
const vector location = hit.origin;
FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
if (
MUTATOR_HOOKFUNCTION(cl_nades, HUD_Draw_overlay)
{
if (STAT(HEALING_ORB) <= time) return false;
- MUTATOR_ARGV(0, vector) = NADE_TYPE_HEAL.m_color;
- MUTATOR_ARGV(0, float) = STAT(HEALING_ORB_ALPHA);
+ M_ARGV(0, vector) = NADE_TYPE_HEAL.m_color;
+ M_ARGV(1, float) = STAT(HEALING_ORB_ALPHA);
return true;
}
MUTATOR_HOOKFUNCTION(cl_nades, Ent_Projectile)
*/
#define EV_Nade_Damage(i, o) \
/** weapon */ i(entity, MUTATOR_ARGV_0_entity) \
- /** force */ i(vector, MUTATOR_ARGV_0_vector) \
- /**/ o(vector, MUTATOR_ARGV_0_vector) \
- /** damage */ i(float, MUTATOR_ARGV_0_float) \
- /**/ o(float, MUTATOR_ARGV_0_float) \
+ /** force */ i(vector, MUTATOR_ARGV_1_vector) \
+ /**/ o(vector, MUTATOR_ARGV_1_vector) \
+ /** damage */ i(float, MUTATOR_ARGV_2_float) \
+ /**/ o(float, MUTATOR_ARGV_2_float) \
/**/
MUTATOR_HOOKABLE(Nade_Damage, EV_Nade_Damage);
MUTATOR_HOOKFUNCTION(hmg_nadesupport, Nade_Damage)
{
SELFPARAM();
- if (MUTATOR_ARGV(0, entity) != WEP_HMG) return;
+ if (M_ARGV(0, entity) != WEP_HMG) return;
return = true;
- MUTATOR_ARGV(0, float) /* damage */ = self.max_health * 0.1;
+ M_ARGV(2, float) /* damage */ = self.max_health * 0.1;
}
spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(this, WEP_HMG); }
MUTATOR_HOOKFUNCTION(ok, W_DecreaseAmmo)
{
- entity actor = MUTATOR_ARGV(0, entity);
+ entity actor = M_ARGV(0, entity);
if (actor.ok_use_ammocharge)
{
ok_DecreaseCharge(actor, PS(actor).m_weapon.m_id);
MUTATOR_HOOKFUNCTION(ok, W_Reload)
{
- entity actor = MUTATOR_ARGV(0, entity);
+ entity actor = M_ARGV(0, entity);
return actor.ok_use_ammocharge;
}
if (s == WP_Item.netname || s == RADARICON_Item.netname) return Items_from(this.wp_extra).m_color;
if (MUTATOR_CALLHOOK(WP_Format, this, s))
{
- return MUTATOR_ARGV(0, vector);
+ return M_ARGV(2, vector);
}
return def;
}
if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).monster_name;
if (MUTATOR_CALLHOOK(WP_Format, this, s))
{
- return MUTATOR_ARGV(0, string);
+ return M_ARGV(3, string);
}
// need to loop, as our netname could be one of three
#define EV_PlayerDamaged(i, o) \
/** attacker */ i(entity, MUTATOR_ARGV_0_entity) \
/** target */ i(entity, MUTATOR_ARGV_1_entity) \
- /** health */ i(int, MUTATOR_ARGV_0_int) \
- /** armor */ i(int, MUTATOR_ARGV_1_int) \
- /** location */ i(vector, MUTATOR_ARGV_0_vector) \
- /** deathtype */ i(int, MUTATOR_ARGV_2_int) \
+ /** health */ i(int, MUTATOR_ARGV_2_int) \
+ /** armor */ i(int, MUTATOR_ARGV_3_int) \
+ /** location */ i(vector, MUTATOR_ARGV_4_vector) \
+ /** deathtype */ i(int, MUTATOR_ARGV_5_int) \
/**/
MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged);