// step 4: write queue
WEP_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, W_Name(i)))
- for(x = 0; x <= WEP_CONFIG_COUNT; ++x)
- { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) }
+ for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) }
WEP_CONFIG_WRITETOFILE("// }}}\n")
// step 5: debug info
if(head.takedamage)
{
- // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
center = PLAYER_CENTER(head);
float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
}
case WR_RELOAD:
{
- W_Reload(min(max(WEP_CVAR(uzi, sustained_ammo), WEP_CVAR(uzi, first_ammo)), WEP_CVAR(uzi, burst_ammo)), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
+ entity weapon = get_weaponinfo(WEP_UZI);
+ W_Reload(min(max(WEP_CVAR(uzi, sustained_ammo), WEP_CVAR(uzi, first_ammo)), WEP_CVAR(uzi, burst_ammo)), weapon.reloading_ammo, weapon.reloading_time, "weapons/reload.wav");
return TRUE;
}
case WR_SUICIDEMESSAGE:
self.weaponentity.state = WS_RAISE;
// set our clip load to the load of the weapon we switched to, if it's reloadable
- if(newwep.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", newwep.netname, "_reload_ammo"))) // prevent accessing undefined cvars
+ if(newwep.spawnflags & WEP_FLAG_RELOADABLE && newwep.reloading_ammo) // prevent accessing undefined cvars
{
self.clip_load = self.(weapon_load[self.switchweapon]);
- self.clip_size = cvar(strcat("g_balance_", newwep.netname, "_reload_ammo"));
+ self.clip_size = newwep.reloading_ammo;
}
else
self.clip_load = self.clip_size = 0;