From 93ce3c84c3ec5b5f6d36aa2a5bcee18914294879 Mon Sep 17 00:00:00 2001 From: def Date: Wed, 20 Apr 2016 11:59:14 +0200 Subject: [PATCH] Add fake tuning for hammer hit --- src/game/server/entities/character.cpp | 8 ++++++++ src/game/server/entities/character.h | 1 + src/game/server/gamecontext.cpp | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index eca92cc72..c5afb6fde 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -1515,11 +1515,15 @@ void CCharacter::HandleTiles(int Index) { GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hit others"); m_Hit = DISABLE_HIT_GRENADE|DISABLE_HIT_HAMMER|DISABLE_HIT_RIFLE|DISABLE_HIT_SHOTGUN; + m_NeededFaketuning |= FAKETUNE_NOHAMMER; + GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings } else if(((m_TileIndex == TILE_HIT_START) || (m_TileFIndex == TILE_HIT_START)) && m_Hit != HIT_ALL) { GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hit others"); m_Hit = HIT_ALL; + m_NeededFaketuning &= ~FAKETUNE_NOHAMMER; + GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings } // collide with others @@ -1704,11 +1708,15 @@ void CCharacter::HandleTiles(int Index) { GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can hammer hit others"); m_Hit &= ~DISABLE_HIT_HAMMER; + m_NeededFaketuning &= ~FAKETUNE_NOHAMMER; + GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings } else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_END && !(m_Hit&DISABLE_HIT_HAMMER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER) { GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't hammer hit others"); m_Hit |= DISABLE_HIT_HAMMER; + m_NeededFaketuning |= FAKETUNE_NOHAMMER; + GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings } else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_START && m_Hit&DISABLE_HIT_SHOTGUN && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN) { diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h index e7313ce0b..c22908405 100644 --- a/src/game/server/entities/character.h +++ b/src/game/server/entities/character.h @@ -26,6 +26,7 @@ enum FAKETUNE_NOCOLL = 8, FAKETUNE_NOHOOK = 16, FAKETUNE_JETPACK = 32, + FAKETUNE_NOHAMMER = 64, }; class CCharacter : public CEntity diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 4c1016e09..e53c9a776 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -553,6 +553,11 @@ void CGameContext::SendTuningParams(int ClientID, int Zone) { Msg.AddInt(0); } + else if((i==36) // hammer hit + && m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning() & FAKETUNE_NOHAMMER) + { + Msg.AddInt(0); + } else { Msg.AddInt(pParams[i]);