[fix] Weapon Fixes


(sniser) #1

Only two so far - if you come across anything similar (stuff missing from a list, or stuff being in a list that shouldn’t), add it here!

in g_weapon.c:

qboolean IsSilencedWeapon
(
	// The type of weapon in question.  Is it silenced?
	int weaponType
)
{
	// Local Variables ////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////
	// Return true for any of the silenced types
	switch (weaponType)
	{
	case WP_SILENCED_COLT:
	case WP_STEN:
	case WP_SILENCER:
		return qtrue;
	};
	// Otherwise, not silenced
	return qfalse;
}

add those to the list:

	case WP_AKIMBO_SILENCEDLUGER:
	case WP_AKIMBO_SILENCEDCOLT:

Haven’t checked where this function is called and if it makes any actual difference though :smiley: (edit: as stated below this code isn’t used anyway, so nevermind :P)

In g_stats.c, function G_LooseSkillPoints:


		case MOD_KNIFE:
		case MOD_LUGER:
		case MOD_COLT:
		case MOD_MP40:
		case MOD_THOMPSON:
		case MOD_STEN:
		case MOD_GARAND:
		case MOD_SILENCER:
		case MOD_FG42:
		case MOD_CARBINE:
		case MOD_KAR98:
		case MOD_SILENCED_COLT:
		case MOD_K43:
		case MOD_GRENADE_LAUNCHER:
		case MOD_GRENADE_PINEAPPLE:

add these:


		case WP_AKIMBO_LUGER:
		case WP_AKIMBO_SILENCEDLUGER:
		case WP_AKIMBO_COLT:
		case WP_AKIMBO_SILENCEDCOLT:

This makes you loose XP for complaints when using Akimbos, too.


(Svartberg.) #2

Good work !

One thing you didn’t notice though, We should Use MOD_ instead of WP_ . (“WP_” is “weapon_t” variable, while “MOD_” is “meansOfDeath_t” variable)


(sniser) #3

I had that stuff still in the clipboard from the first snippet - thanks for pointing that out before it confused anyone!!


(digibob) #4

The first change is kinda redundant, as that function isn’t used anywhere any more. It’s likely some old code from the single player bots.