Bug 2853 - Buy energy ammo annoyance
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: PC All
: P2 trivial
Assignee: Tim Angus
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2006-08-26 16:55 EDT by Martin Doucha
Modified: 2006-11-17 15:16:15 EST
0 users

See Also:


Attachments
Annoyance fix (1.54 KB, patch)
2006-08-26 17:00 EDT, Martin Doucha
Annoyance fix (674 bytes, patch)
2006-08-26 17:05 EDT, Martin Doucha
svn844 energy weapons (16.48 KB, patch)
2006-11-15 10:42 EST, Tony J. White
svn844 energy weapons (1.60 KB, patch)
2006-11-15 10:45 EST, Tony J. White

Description Martin Doucha 2006-08-26 16:55:07 EDT
When you have energy weapon and you hold blaster, buying ammo from Reactor or Repeater will trigger message that you have to use Armoury and buying ammo at Armoury doesn't work for energy weapons.
Comment 1 Martin Doucha 2006-08-26 17:00:04 EDT
Created attachment 1042 [details]
Annoyance fix

This patch makes decision whether to buy energy ammo or not on the main weapon instead of the weapon currently held. It uses G_FindNonBlasterWeapon() from Weaponswitch redundancy cleanup version 2 patch for bug 2825.
Comment 2 Martin Doucha 2006-08-26 17:01:45 EDT
Comment on attachment 1042 [details]
Annoyance fix

>Index: src/game/g_cmds.c
>===================================================================
>--- src/game/g_cmds.c	(revision 813)
>+++ src/game/g_cmds.c	(working copy)
>@@ -1842,8 +1826,11 @@
>   upgrade = BG_FindUpgradeNumForName( s );
> 
>   //special case to keep norf happy
>-  if( weapon == WP_NONE && upgrade == UP_AMMO )
>-    buyingEnergyAmmo = BG_FindUsesEnergyForWeapon( ent->client->ps.weapon );
>+  if( weapon == WP_NONE && upgrade == UP_AMMO ) {
>+    // we don't buy ammo for blaster, we buy it for main weapon!
>+    int mainWeapon = G_FindNonBlasterWeapon( ent );
>+    buyingEnergyAmmo = BG_FindUsesEnergyForWeapon( mainWeapon );
>+  }
> 
>   if( buyingEnergyAmmo )
>   {
Comment 3 Martin Doucha 2006-08-26 17:05:02 EDT
Created attachment 1043 [details]
Annoyance fix

Ahhh, sorry for the mess, I forgot to remove a few lines that belong to another patch...
Comment 4 Tony J. White 2006-11-15 10:42:14 EST
Created attachment 1153 [details]
svn844 energy weapons

* allows buying energy ammo if any weapon in inventory uses energy
* also contains patch for 2827 because I'm lazy
Comment 5 Tony J. White 2006-11-15 10:43:42 EST
Comment on attachment 1153 [details]
svn844 energy weapons

oops
Comment 6 Tony J. White 2006-11-15 10:45:12 EST
Created attachment 1154 [details]
svn844 energy weapons

lets try that again
Comment 7 Tony J. White 2006-11-17 15:16:15 EST
comitted as revision 848