Add fake tuning for hammer hit

This commit is contained in:
def 2016-04-20 11:59:14 +02:00
parent 8fdeb9df58
commit 93ce3c84c3
3 changed files with 14 additions and 0 deletions

View file

@ -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)
{

View file

@ -26,6 +26,7 @@ enum
FAKETUNE_NOCOLL = 8,
FAKETUNE_NOHOOK = 16,
FAKETUNE_JETPACK = 32,
FAKETUNE_NOHAMMER = 64,
};
class CCharacter : public CEntity

View file

@ -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]);