instagib_stop_countdown(player);
}
+MUTATOR_HOOKFUNCTION(mutator_instagib, ShouldGiveRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
PHYS_INPUT_BUTTON_ATCK2(player) = false;
}
+MUTATOR_HOOKFUNCTION(ok, ShouldGiveRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect)
{
entity player = M_ARGV(0, entity);
this.health = start_health;
this.armorvalue = start_armorvalue;
this.weapons = start_weapons;
- GiveRandomWeapons(this, random_start_weapons_count,
- autocvar_g_random_start_weapons, random_start_ammo);
+ if (MUTATOR_CALLHOOK(ShouldGiveRandomStartWeapons, this) == false)
+ {
+ GiveRandomWeapons(this, random_start_weapons_count,
+ autocvar_g_random_start_weapons, random_start_ammo);
+ }
}
SetSpectatee_status(this, 0);
/**/
MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn);
+/** called when player spawns to determine whether to give them random start weapons. Return true to forbid giving them. */
+#define EV_ShouldGiveRandomStartWeapons(i, o) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /**/
+MUTATOR_HOOKABLE(ShouldGiveRandomStartWeapons, EV_ShouldGiveRandomStartWeapons);
+
/** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */
#define EV_PlayerSpawn(i, o) \
/** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \