if(nt_IsNewToy(it.m_id))
it.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
});
+
+ cvar_settemp("sv_nexuizcompat_weaponswap", "0"); // disable compatibility so these weapons aren't auto replaced elsewhere
}
MUTATOR_ONROLLBACK_OR_REMOVE
void StartItem(entity this, GameItem def)
{
def = def.m_spawnfunc_hookreplace(def, this);
+ if (def.instanceOfWeapon)
+ {
+ weapon_defaultspawnfunc(this, def);
+ return;
+ }
if (def.spawnflags & ITEM_FLAG_MUTATORBLOCKED)
{
delete(this);
#ifdef SVQC
+METHOD(HLAC, m_spawnfunc_hookreplace, Weapon(HLAC this, entity e))
+{
+ if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+ {
+ return ITEM_ArmorBig;
+ }
+ return this;
+}
+
void W_HLAC_Touch(entity this, entity toucher)
{
float isprimary;
#ifdef SVQC
+METHOD(MineLayer, m_spawnfunc_hookreplace, Weapon(MineLayer this, entity e))
+{
+ if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+ {
+ return ITEM_HealthBig;
+ }
+ return this;
+}
+
void W_MineLayer_Stick(entity this, entity to)
{
spamsound(this, CH_SHOTS, SND_MINE_STICK, VOL_BASE, ATTN_NORM);
#ifdef SVQC
+METHOD(Rifle, m_spawnfunc_hookreplace, Weapon(Rifle this, entity e))
+{
+ if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+ {
+ return ITEM_ArmorBig;
+ }
+ return this;
+}
+
void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, Sound pSound, entity actor)
{
float i;
#ifdef SVQC
+METHOD(Seeker, m_spawnfunc_hookreplace, Weapon(Seeker this, entity e))
+{
+ if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+ {
+ return ITEM_HealthBig;
+ }
+ return this;
+}
+
// ============================
// Begin: Missile functions, these are general functions to be manipulated by other code
// ============================
int autocvar_sv_name_maxlength = 64;
bool autocvar_sv_precacheplayermodels;
bool autocvar_sv_q3acompat_machineshotgunswap;
+bool autocvar_sv_nexuizcompat_weaponswap = true;
bool autocvar_sv_servermodelsonly;
int autocvar_sv_spectate;
float autocvar_sv_spectator_speed_multiplier;
void weapon_defaultspawnfunc(entity this, Weapon wpn)
{
wpn = wpn.m_spawnfunc_hookreplace(wpn, this);
+ if (!wpn.instanceOfWeapon)
+ {
+ StartItem(this, wpn);
+ return;
+ }
this.classname = wpn.m_canonical_spawnfunc;
if (!Item_IsLoot(this) && !this.m_isreplaced)
{
set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping machinegun and shotgun (for Q3A map compatibility in mapinfo files)"
set sv_q3defragcompat 0 "toggle for some compatibility hacks (for Q3DF map compatibility)"
+set sv_nexuizcompat_weaponswap 1 "automatically replace legacy weapons with health and armor items (for Nexuiz map compatibility), automatically disabled by the New Toys mutator"
set g_movement_highspeed 1 "multiplier scale for movement speed (applies to sv_maxspeed and sv_maxairspeed, also applies to air acceleration when g_movement_highspeed_q3_compat is set to 0)"
set g_movement_highspeed_q3_compat 0 "apply speed modifiers to air movement in a more Q3-compatible way (only apply speed buffs and g_movement_highspeed to max air speed, not to acceleration)"