about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsavander <savander.pl@gmail.com>2014-09-26 12:56:03 +0200
committersavander <savander.pl@gmail.com>2014-09-26 12:56:03 +0200
commit8c329ade7507d3f1641018f302bf2396af6a471a (patch)
tree960aee6d293271e28506a38cb7fda9a1b4677350
parent684ae6c63e0f78ee9ab9b06926607225014bfc8f (diff)
downloadzcatch-8c329ade7507d3f1641018f302bf2396af6a471a.tar.gz
zcatch-8c329ade7507d3f1641018f302bf2396af6a471a.zip
RespawnProtection: prevent crash
-rw-r--r--src/game/server/entities/character.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index b541f240..139422af 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -884,7 +884,7 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
 	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())
+	if(From >= 0 && (m_pPlayer->m_RespawnProtection > Server()->Tick() || GameServer()->m_apPlayers[From]->m_RespawnProtection > Server()->Tick()))
 		return false;
 	m_Health = 0;
 	m_Armor = 0;