View Single Post
Old 08-01-2006, 11:40 PM   #85
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
k so this one is kind of raven's fault, they forgot many many many checks for their EF_DOUBLE_AMMO, thus tech's cannot give you ammo > than the normal max and you cannot pickup ammo > normal max (this is usually for siege).

Open up g_items.c and Change the function "Add_Ammo" to look like this:

Code:
void Add_Ammo (gentity_t *ent, int weapon, int count)
{
	if ( ent->client->ps.eFlags & EF_DOUBLE_AMMO ) {
		if ( ent->client->ps.ammo[weapon] < ammoData[weapon].max*2 )
		{
			ent->client->ps.ammo[weapon] += count;
			if ( ent->client->ps.ammo[weapon] > ammoData[weapon].max*2 )
			{
				ent->client->ps.ammo[weapon] = ammoData[weapon].max*2;
			}
		}
	} else {
		if ( ent->client->ps.ammo[weapon] < ammoData[weapon].max )
		{
			ent->client->ps.ammo[weapon] += count;
			if ( ent->client->ps.ammo[weapon] > ammoData[weapon].max )
			{
				ent->client->ps.ammo[weapon] = ammoData[weapon].max;
			}
		}
	}
}
Open up g_utils.c and look for the function "G_UseDispenserOn":

change the else if statement for ammodisp to:

Code:
	else if (dispType == HI_AMMODISP)
	{
		if (ent->client->medSupplyDebounce < level.time)
		{ //do the next increment
			//increment based on the amount of ammo used per normal shot.
			target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] += weaponData[target->client->ps.weapon].energyPerShot;

			if ( target->client->ps.eFlags & EF_DOUBLE_AMMO ) {
				if (target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] > ammoData[weaponData[target->client->ps.weapon].ammoIndex].max*2)
				{ //cap it off
					target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] = ammoData[weaponData[target->client->ps.weapon].ammoIndex].max*2;
				}
			} else {
				if (target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] > ammoData[weaponData[target->client->ps.weapon].ammoIndex].max)
				{ //cap it off
					target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] = ammoData[weaponData[target->client->ps.weapon].ammoIndex].max;
				}
			}

			//base the next supply time on how long the weapon takes to fire. Seems fair enough.
			ent->client->medSupplyDebounce = level.time + weaponData[target->client->ps.weapon].fireTime;
		}
		target->client->isMedSupplied = level.time + 500;
	}
next function down "G_CanUseDispOn":


change the else if statement for ammodisp to:

Code:
	else if (dispType == HI_AMMODISP)
	{
		if (ent->client->ps.weapon <= WP_NONE || ent->client->ps.weapon > LAST_USEABLE_WEAPON)
		{ //not a player-useable weapon
			return 0;
		}

		if ( ent->client->ps.eFlags & EF_DOUBLE_AMMO ) {
			if (ent->client->ps.ammo[weaponData[ent->client->ps.weapon].ammoIndex] < ammoData[weaponData[ent->client->ps.weapon].ammoIndex].max*2)
			{ //needs more ammo for current weapon
				return 1;
			}
		} else {
			if (ent->client->ps.ammo[weaponData[ent->client->ps.weapon].ammoIndex] < ammoData[weaponData[ent->client->ps.weapon].ammoIndex].max)
			{ //needs more ammo for current weapon
				return 1;
			}
		}

		//needs none
		return 0;
	}
I think that is all.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,