Tremulous Forum
General => Feedback => Topic started by: SLAVE|Mietz on April 08, 2006, 12:12:54 pm
-
I noticed that if you hit reload while your weapon has full ammo, the full cardridge will be discarded completely.
I don't know, is this a bug or a feature? (to bring in more reality)
Maybe it would be possible to deactivate the reloading function when the ammo-cardridge is full.
-
I've wondered about this myself. Considering how Trem handles magazines (eg any left over rounds in a magazine are simply discarded), I think it might be intentional.
-
It's intentional i think.
I've seen in in Battlefield 1942 aswell and i think it's fairly logical since we're dealing with cartridges here, not individual bullets.
And disabling reloading when you have half a clip left isn't a good idea.
I like to have a full cartridge to shoot when going into combat.
-
This is "fixed" on AKKA as I didn't really see the point, an accidental keypress shouldn't throw away an entire clip of ammo. Whether it is a bug or feature though I cannot say.
-
Feature.
-
Newbie trap! :roll:
-
It's intentional i think.
I've seen in in Battlefield 1942 aswell and i think it's fairly logical since we're dealing with cartridges here, not individual bullets.
And disabling reloading when you have half a clip left isn't a good idea.
I like to have a full cartridge to shoot when going into combat.
Now I didn't say that the half cartridge should be blocked, only the full cartridge.
-
Sorry, i read half-full :P
-
Well, here's a patch for game/bg_pmove.c that blocks full-ammo reloads. Works against both 1.1.0 and CVS.
--- /usr/src/tremulous-1.1.0-src/src/game/bg_pmove.c 2006-01-12 18:05:09.000000000 +0100
+++ bg_pmove.c 2006-05-08 14:50:08.000000000 +0200
@@ -2674,7 +2674,7 @@
static void PM_Weapon( void )
{
int addTime = 200; //default addTime - should never be used
- int ammo, clips, maxClips;
+ int ammo, maxammo, clips, maxClips;
qboolean attack1 = qfalse;
qboolean attack2 = qfalse;
qboolean attack3 = qfalse;
@@ -2810,14 +2810,22 @@
{
pm->ps->pm_flags &= ~PMF_WEAPON_RELOAD;
- pm->ps->weaponstate = WEAPON_RELOADING;
+ BG_FindAmmoForWeapon( pm->ps->weapon, &maxammo, NULL );
+ if( BG_FindUsesEnergyForWeapon( pm->ps->weapon ) &&
+ BG_InventoryContainsUpgrade( UP_BATTPACK, pm->ps->stats ) )
+ maxammo = (int)( (float)maxammo * BATTPACK_MODIFIER );
- //drop the weapon
- PM_StartTorsoAnim( TORSO_DROP );
+ // don't reload full clips
+ if(ammo < maxammo) {
+ pm->ps->weaponstate = WEAPON_RELOADING;
- addTime = BG_FindReloadTimeForWeapon( pm->ps->weapon );
+ //drop the weapon
+ PM_StartTorsoAnim( TORSO_DROP );
- pm->ps->weaponTime += addTime;
+ addTime = BG_FindReloadTimeForWeapon( pm->ps->weapon );
+
+ pm->ps->weaponTime += addTime;
+ }
return;
}
-
Every FPS i have ever played uses this feature. :-?
-
A little question for the devs. Do you think that this is a good idea:
bg_pmove.c lines 2780-2786:
static void PM_Weapon( void ) {
...
// check for out of ammo
if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) )
{
PM_AddEvent( EV_NOAMMO );
pm->ps->weaponTime += 200;
return;
}
... lines 2712-2738
// check for weapon change
// can't change if weapon is firing, but can change
// again if lowering or raising
if( pm->ps->weaponTime <= 0 || pm->ps->weaponstate != WEAPON_FIRING )
{
//TA: must press use to switch weapons
if( pm->cmd.buttons & BUTTON_USE_HOLDABLE )
{
if( !( pm->ps->pm_flags & PMF_USE_ITEM_HELD ) )
{
if( pm->cmd.weapon <= 32 )
{
//if trying to select a weapon, select it
if( pm->ps->weapon != pm->cmd.weapon )
PM_BeginWeaponChange( pm->cmd.weapon );
}
else if( pm->cmd.weapon > 32 )
{
//if trying to toggle an upgrade, toggle it
if( BG_InventoryContainsUpgrade( pm->cmd.weapon - 32, pm->ps->stats ) ) //sanity check
{
if( BG_UpgradeIsActive( pm->cmd.weapon - 32, pm->ps->stats ) )
BG_DeactivateUpgrade( pm->cmd.weapon - 32, pm->ps->stats );
else
BG_ActivateUpgrade( pm->cmd.weapon - 32, pm->ps->stats );
}
}
pm->ps->pm_flags |= PMF_USE_ITEM_HELD;
}
}
...
}
This little piece of code (lines 2780 thru 2786) does nothing for weapons except grenade (the only weapon with EV_NOAMMO handler). It simply repeatedly blocks weapon actions for 200ms. That also means it blocks item toggle button because items can be toggled in PM_Weapon() only if pm->ps->weaponTime <= 0 and WEAPON_FIRING flag is not set (lines 2712 thru 2738). It also seems the WEAPON_FIRING flag is never cleared because PM_Weapon() exits before it checks for attacks.
Edit: https://bugzilla.icculus.org/show_bug.cgi?id=2737