about summary refs log tree commit diff
path: root/src/game/server/entities
diff options
context:
space:
mode:
authorTeetime <TeetimeTW@yahoo.de>2012-02-18 18:24:07 +0100
committerTeetime <TeetimeTW@yahoo.de>2012-02-18 18:24:07 +0100
commitfd9d2084828292f88f569a4d02e75b30a7f6fdc2 (patch)
tree45c4835af03568ceb16e37697dd7e30c935cff1a /src/game/server/entities
parent8cfdd5b7e75cec9a1bcd9838bef2a6324c278169 (diff)
downloadzcatch-fd9d2084828292f88f569a4d02e75b30a7f6fdc2.tar.gz
zcatch-fd9d2084828292f88f569a4d02e75b30a7f6fdc2.zip
no endless ammo for grenade and all weapons, so player cannot shoot anymore all the time
Diffstat (limited to 'src/game/server/entities')
-rw-r--r--src/game/server/entities/character.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index c70e0850..47f5e9f4 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -472,6 +472,17 @@ void CCharacter::HandleWeapons()
 
 	// ammo regen
 	int AmmoRegenTime = g_pData->m_Weapons.m_aId[m_ActiveWeapon].m_Ammoregentime;
+	if(GameServer()->m_pController->IsZCatch() && m_aWeapons[m_ActiveWeapon].m_Ammo > -1)
+	{
+		switch(m_ActiveWeapon)
+		{
+			case WEAPON_GUN: AmmoRegenTime = 125*5; break;
+			case WEAPON_GRENADE: AmmoRegenTime = 1000; break;
+			case WEAPON_RIFLE: AmmoRegenTime = 1200; break;
+			case WEAPON_SHOTGUN: AmmoRegenTime = 1000; break;
+		}
+	}
+
 	if(AmmoRegenTime)
 	{
 		// If equipped and not active, regen ammo?
@@ -483,7 +494,7 @@ void CCharacter::HandleWeapons()
 			if ((Server()->Tick() - m_aWeapons[m_ActiveWeapon].m_AmmoRegenStart) >= AmmoRegenTime * Server()->TickSpeed() / 1000)
 			{
 				// Add some ammo
-				m_aWeapons[m_ActiveWeapon].m_Ammo = min(m_aWeapons[m_ActiveWeapon].m_Ammo + 1, 10);
+				m_aWeapons[m_ActiveWeapon].m_Ammo = min(m_aWeapons[m_ActiveWeapon].m_Ammo + 1, (GameServer()->m_pController->IsZCatch()) ? 6 : 10);
 				m_aWeapons[m_ActiveWeapon].m_AmmoRegenStart = -1;
 			}
 		}