Commit 467f9a68 authored by Mario's avatar Mario

Merge branch 'TimePath/issues/1434' into 'master'

Fix broken reloadable weapons (and somehow players using random models)

See issue #1434

See merge request !65
parents ef699c7a 0bb8d570
...@@ -691,7 +691,7 @@ void W_WeaponFrame() ...@@ -691,7 +691,7 @@ void W_WeaponFrame()
self.weapon = self.switchweapon; self.weapon = self.switchweapon;
self.weaponname = newwep.mdl; self.weaponname = newwep.mdl;
self.bulletcounter = 0; self.bulletcounter = 0;
//self.ammo_field = newwep.ammo_field; self.ammo_field = newwep.ammo_field;
Please register or sign in to reply
WEP_ACTION(self.switchweapon, WR_SETUP); WEP_ACTION(self.switchweapon, WR_SETUP);
self.weaponentity.state = WS_RAISE; self.weaponentity.state = WS_RAISE;
...@@ -864,11 +864,10 @@ void W_ReloadedAndReady() ...@@ -864,11 +864,10 @@ void W_ReloadedAndReady()
self.clip_load = self.reload_ammo_amount; self.clip_load = self.reload_ammo_amount;
else else
{ {
while(self.clip_load < self.reload_ammo_amount && self.(self.ammo_field)) // make sure we don't add more ammo than we have // 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));
  • Nice independent improvement. More beasts like this may lurk around - these fixes are appreciated.

Please register or sign in to reply
self.clip_load += 1; self.clip_load += load;
self.(self.ammo_field) -= 1; self.(self.ammo_field) -= load;
}
} }
self.(weapon_load[self.weapon]) = self.clip_load; self.(weapon_load[self.weapon]) = self.clip_load;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment