for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
return FALSE;
+ if(self.weapon == WEP_SHOTGUN)
+ if(!secondary && WEP_CVAR(shotgun, secondary) == 1)
+ return FALSE; // no clicking, just allow
+
if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
{
sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTEN_NORM);
return 1;
if(self.frozen)
return 1;
+ if(self.weapon_blocked)
+ return 1;
return 0;
}
self.weapon = self.switchweapon;
self.weaponname = newwep.mdl;
self.bulletcounter = 0;
- //self.ammo_field = newwep.ammo_field;
+ self.ammo_field = newwep.ammo_field;
WEP_ACTION(self.switchweapon, WR_SETUP);
self.weaponentity.state = WS_RAISE;
{
entity wep = get_weaponinfo(self.weapon);
+ if(cvar("g_overkill"))
+ if(self.ok_use_ammocharge)
+ {
+ ok_DecreaseCharge(self, self.weapon);
+ return; // TODO
+ }
+
if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !wep.reloading_ammo)
return;
self.clip_load = self.reload_ammo_amount;
else
{
- while(self.clip_load < self.reload_ammo_amount && self.(self.ammo_field)) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.(self.ammo_field) -= 1;
- }
+ // make sure we don't add more ammo than we have
+ float load = min(self.reload_ammo_amount - self.clip_load, self.(self.ammo_field));
+ self.clip_load += load;
+ self.(self.ammo_field) -= load;
}
self.(weapon_load[self.weapon]) = self.clip_load;
entity e;
e = get_weaponinfo(self.weapon);
+ if(cvar("g_overkill"))
+ if(self.ok_use_ammocharge)
+ return; // TODO
+
self.reload_ammo_min = sent_ammo_min;
- self.reload_ammo_amount = e.reloading_ammo;;
+ self.reload_ammo_amount = e.reloading_ammo;
self.reload_time = e.reloading_time;
self.reload_sound = sent_sound;
self.old_clip_load = self.clip_load;
self.clip_load = self.(weapon_load[self.weapon]) = -1;
}
+
+entity weapon_dropevent_item;
+void W_DropEvent(float event, entity player, float weapon_type, entity weapon_item)
+{
+ entity oldself = self;
+ self = player;
+ weapon_dropevent_item = weapon_item;
+ WEP_ACTION(weapon_type, event);
+ self = oldself;
+}