From 684ae6c63e0f78ee9ab9b06926607225014bfc8f Mon Sep 17 00:00:00 2001 From: savander Date: Sun, 21 Sep 2014 14:54:06 +0200 Subject: Update --- src/game/server/entities/character.cpp | 5 ++++- src/game/server/entities/character.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game/server/entities') 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 */ diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h index 0d68707a..240ee0e2 100644 --- a/src/game/server/entities/character.h +++ b/src/game/server/entities/character.h @@ -73,6 +73,8 @@ public: bool HasBeenThereRecently(vec2 v, const vec2 *&pos, int firstTick, int lastTick) const; bool AimedAtCharRecently(vec2 v, const CCharacter *c, const vec2 *&pos, const vec2 *&posVictim, int firstTick); float HowCloseToXRecently(vec2 x, const vec2 *&pos, int firstTick); + void SetEmoteType(int EmoteType) { m_EmoteType = EmoteType; }; + void SetEmoteStop(int EmoteStop) { m_EmoteStop = EmoteStop; }; private: // player controlling this character @@ -105,6 +107,7 @@ private: int m_EmoteType; int m_EmoteStop; + // last tick that the player took any action ie some input int m_LastAction; int m_LastNoAmmoSound; -- cgit 1.4.1