#define WEP_CONFIG_WRITE_CVARS(weapon,mode,name) \
#if mode == MO_PRI \
{ WEP_CONFIG_WRITE(sprintf( \
- "set g_balance_%s_primary_%s %f\n", \
+ "set g_balance_%s_primary_%s %g\n", \
#weapon, \
#name, \
autocvar_g_balance_##weapon##_primary_##name)) } \
#endif \
#if mode == MO_SEC \
- { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s %f\n", \
+ { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s %g\n", \
#weapon, \
#name, \
autocvar_g_balance_##weapon##_secondary_##name)) } \
#endif \
#if mode == MO_BOTH \
- { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s %f\n", \
+ { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s %g\n", \
#weapon, \
#name, \
autocvar_g_balance_##weapon##_primary_##name)) } \
- { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s %f\n", \
+ { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s %g\n", \
#weapon, \
#name, \
autocvar_g_balance_##weapon##_secondary_##name)) } \
#endif \
#if mode == MO_NONE \
- { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s %f\n", \
+ { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s %g\n", \
#weapon, \
#name, \
autocvar_g_balance_##weapon##_##name)) } \
#endif
#define WEP_CONFIG_WRITE_PROPS(weapon,prop,name) \
- { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s %f\n", \
+ { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s %g\n", \
#weapon, \
#name, \
autocvar_g_balance_##weapon##_##name)) }
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_arc.md3");
precache_model ("models/weapons/v_arc.md3");
void ArcInit()
{
- WEP_ACTION(WEP_ARC, WR_PRECACHE);
+ WEP_ACTION(WEP_ARC, WR_INIT);
arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 1);
arc_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 2);
arc_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 3);
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/arc_impact.wav");
precache_sound("weapons/arc_impact_combo.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model("models/weapons/g_laser.md3");
precache_model("models/weapons/v_laser.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/laserimpact.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_crylink.md3");
precache_model ("models/weapons/v_crylink.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/crylink_impact2.wav");
precache_sound("weapons/crylink_impact.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
if(autocvar_sv_precacheweapons)
{
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/rocket_impact.wav");
return TRUE;
void ElectroInit()
{
- WEP_ACTION(WEP_ELECTRO, WR_PRECACHE);
+ WEP_ACTION(WEP_ELECTRO, WR_INIT);
electro_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ELECTRO), FALSE, FALSE, 1);
electro_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ELECTRO), FALSE, FALSE, 2);
electro_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ELECTRO), FALSE, FALSE, 3);
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_electro.md3");
precache_model ("models/weapons/v_electro.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_fireball.md3");
precache_model ("models/weapons/v_fireball.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/fireball_impact2.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_hagar.md3");
precache_model ("models/weapons/v_hagar.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/hagexp1.wav");
precache_sound("weapons/hagexp2.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_hlac.md3");
precache_model ("models/weapons/v_hlac.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/laserimpact.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_hookgun.md3");
precache_model ("models/weapons/v_hookgun.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/hookbomb_impact.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/uziflash.md3");
precache_model ("models/weapons/g_uzi.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/flash.md3");
precache_model ("models/mine.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/mine_exp.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/nexflash.md3");
precache_model ("models/weapons/g_minstanex.md3");
precache_sound ("weapons/nexwhoosh1.wav");
precache_sound ("weapons/nexwhoosh2.wav");
precache_sound ("weapons/nexwhoosh3.wav");
- W_Laser(WR_PRECACHE);
+ W_Laser(WR_INIT);
return TRUE;
}
case WR_SETUP:
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/neximpact.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_gl.md3");
precache_model ("models/weapons/v_gl.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/grenade_impact.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/nexflash.md3");
precache_model ("models/weapons/g_nex.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/neximpact.wav");
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_porto.md3");
precache_model ("models/weapons/v_porto.md3");
print("Since when does Porto send DamageInfo?\n");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
// nothing to do
return TRUE;
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_campingrifle.md3");
precache_model ("models/weapons/v_campingrifle.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_seeker.md3");
precache_model ("models/weapons/v_seeker.md3");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/seekerexp1.wav");
precache_sound("weapons/seekerexp2.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/uziflash.md3");
precache_model ("models/weapons/g_shotgun.md3");
}
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
return TRUE;
}
- case WR_PRECACHE:
+ case WR_INIT:
{
precache_model ("models/weapons/g_tuba.md3");
precache_model ("models/weapons/v_tuba.md3");
e.ammo_field = ammo_batteries;
#ifndef MENUQC
- func(WR_PRECACHE);
+ func(WR_INIT);
#endif
}
float w_null(float dummy)
float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
-float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
+float WR_INIT = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
float WR_RELOAD = 9; // (SVQC) does not need to do anything
}
else
{
- WEP_ACTION(WEP_HOOK, WR_PRECACHE);
+ WEP_ACTION(WEP_HOOK, WR_INIT);
hook_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 1);
hook_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 2);
hook_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 3);
{
e = get_weaponinfo(i);
if(WEPSET_CONTAINS_AW(start_weapons, i) || WEPSET_CONTAINS_AW(warmup_start_weapons, i))
- WEP_ACTION(i, WR_PRECACHE);
+ WEP_ACTION(i, WR_INIT);
}
start_ammo_shells = max(0, start_ammo_shells);
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
}
- else if(req == WR_PRECACHE)
+ else if(req == WR_INIT)
{
precache_model("models/weapons/g_porto.md3");
precache_model("models/weapons/v_porto.md3");
nix_nextchange = time; // start the first round now!
else
nix_nextchange = time + autocvar_g_balance_nix_roundtime;
- //WEP_ACTION(nix_weapon, WR_PRECACHE); // forget it, too slow
+ //WEP_ACTION(nix_weapon, WR_INIT); // forget it, too slow
}
if(nix_nextchange != self.nix_lastchange_id) // this shall only be called once per round!
float i;
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
if (NIX_CanChooseWeapon(i))
- WEP_ACTION(i, WR_PRECACHE);
+ WEP_ACTION(i, WR_INIT);
}
MUTATOR_HOOKFUNCTION(nix_ForbidThrowCurrentWeapon)
{
WEPSET_OR_EW(self, j);
if(self.spawnflags == 0 || self.spawnflags == 2)
- WEP_ACTION(e.weapon, WR_PRECACHE);
+ WEP_ACTION(e.weapon, WR_INIT);
break;
}
}
e = get_weaponinfo(j);
if(argv(i) == e.netname)
{
- WEP_ACTION(e.weapon, WR_PRECACHE);
+ WEP_ACTION(e.weapon, WR_INIT);
break;
}
}
POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null);
if not(WEPSET_CONTAINS_AW(save_weapons, j))
if(WEPSET_CONTAINS_EW(e, j))
- WEP_ACTION(wi.weapon, WR_PRECACHE);
+ WEP_ACTION(wi.weapon, WR_INIT);
}
}
POSTGIVE_VALUE(e, strength_finished, 1, "misc/powerup.wav", "misc/poweroff.wav");
StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
if (self.modelindex) // don't precache if self was removed
- WEP_ACTION(e.weapon, WR_PRECACHE);
+ WEP_ACTION(e.weapon, WR_INIT);
}