about summary refs log tree commit diff
path: root/src/game/server/entities/character.cpp
diff options
context:
space:
mode:
authorsavander <savander.pl@gmail.com>2014-09-21 14:54:06 +0200
committersavander <savander.pl@gmail.com>2014-09-21 14:54:06 +0200
commit684ae6c63e0f78ee9ab9b06926607225014bfc8f (patch)
treeb42407c38c7e03c516e8e77d7126ee95df70c3d4 /src/game/server/entities/character.cpp
parent836e03aaa5adb888387c34129b8c39a94dc359b3 (diff)
downloadzcatch-684ae6c63e0f78ee9ab9b06926607225014bfc8f.tar.gz
zcatch-684ae6c63e0f78ee9ab9b06926607225014bfc8f.zip
Update
Diffstat (limited to 'src/game/server/entities/character.cpp')
-rw-r--r--src/game/server/entities/character.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index 2c1828da..b541f240 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -89,6 +89,8 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
 		m_ActiveWeapon = WEAPON_GUN;
 		m_LastWeapon = WEAPON_HAMMER;
 	}
+
+	pPlayer->m_RespawnProtection = Server()->Tick() + Server()->TickSpeed() * 2;
     /* end zCatch */
 	
 	m_LastNoAmmoSound = -1;
@@ -879,10 +881,11 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
 	/* zCatch */
 	if(From == m_pPlayer->GetCID() || Weapon == WEAPON_GAME)
 		return false;
-
 	if(g_Config.m_SvMode == 4 && Weapon == WEAPON_GRENADE && Dmg < g_Config.m_SvGrenadeMinDamage)
 		return false;
 
+	if(m_pPlayer->m_RespawnProtection > Server()->Tick() || GameServer()->m_apPlayers[From]->m_RespawnProtection > Server()->Tick())
+		return false;
 	m_Health = 0;
 	m_Armor = 0;
 	/* end zCatch */