about summary refs log tree commit diff
path: root/src/game/server/entities
diff options
context:
space:
mode:
authorTeetime <anton.tsoulos@yahoo.de>2011-07-03 16:42:29 +0200
committerTeetime <anton.tsoulos@yahoo.de>2011-07-03 16:42:29 +0200
commitde7c2a5f47cc1c854e6210ba056888e7a7ae7a08 (patch)
tree8b1c1cbf8d54fd554d06a1b989b12e51280b55a8 /src/game/server/entities
parent76594f348fc01ef3cad44fc4536dbb732a8ca653 (diff)
downloadzcatch-de7c2a5f47cc1c854e6210ba056888e7a7ae7a08.tar.gz
zcatch-de7c2a5f47cc1c854e6210ba056888e7a7ae7a08.zip
Added general zCatch-Support
Diffstat (limited to 'src/game/server/entities')
-rw-r--r--src/game/server/entities/character.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index 9e2033b2..899557f2 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -56,8 +56,25 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
 {
 	m_EmoteStop = -1;
 	m_LastAction = -1;
-	m_ActiveWeapon = WEAPON_GUN;
-	m_LastWeapon = WEAPON_HAMMER;
+	
+	/*zCatch */
+	if(GameServer()->m_pController->IsZCatch() && g_Config.m_SvMode == 1)
+	{
+		m_ActiveWeapon = WEAPON_RIFLE;
+		m_LastWeapon = WEAPON_RIFLE;
+	}
+	else if(GameServer()->m_pController->IsZCatch() && g_Config.m_SvMode == 3)
+	{
+		m_ActiveWeapon = WEAPON_HAMMER;
+		m_LastWeapon = WEAPON_HAMMER;
+	}
+	else
+	{
+		m_ActiveWeapon = WEAPON_GUN;
+		m_LastWeapon = WEAPON_HAMMER;
+	}
+    /* end zCatch */
+	
 	m_QueuedWeapon = -1;
 
 	m_pPlayer = pPlayer;
@@ -444,7 +461,7 @@ void CCharacter::HandleWeapons()
 
 	// ammo regen
 	int AmmoRegenTime = g_pData->m_Weapons.m_aId[m_ActiveWeapon].m_Ammoregentime;
-	if(AmmoRegenTime)
+	if(AmmoRegenTime && (m_ActiveWeapon == WEAPON_GUN || (GameServer()->m_pController->IsZCatch() && g_Config.m_SvMode == 2))) //zCatch
 	{
 		// If equipped and not active, regen ammo?
 		if (m_ReloadTimer <= 0)
@@ -725,8 +742,14 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
 		m_DamageTaken = 0;
 		GameServer()->CreateDamageInd(m_Pos, 0, Dmg);
 	}
-
-	if(Dmg)
+	/* zCatch*/ 
+	if(GameServer()->m_pController->IsZCatch() && (g_Config.m_SvMode == 1 || g_Config.m_SvMode == 3))
+	{
+		m_Health = 0;
+		m_Armor = 0;
+	}
+	/* end zCatch*/
+	else if(Dmg)
 	{
 		if(m_Armor)
 		{