Rename IsSwitch to GetSwitchType

This commit is contained in:
def 2021-12-19 12:05:51 +01:00
parent 17287de243
commit d479cac089
6 changed files with 39 additions and 39 deletions

View file

@ -704,62 +704,62 @@ void CCharacter::HandleTiles(int Index)
} }
// handle switch tiles // handle switch tiles
if(Collision()->IsSwitch(MapIndex) == TILE_FREEZE && Team() != TEAM_SUPER) if(Collision()->GetSwitchType(MapIndex) == TILE_FREEZE && Team() != TEAM_SUPER)
{ {
if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]) if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
Freeze(Collision()->GetSwitchDelay(MapIndex)); Freeze(Collision()->GetSwitchDelay(MapIndex));
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER) else if(Collision()->GetSwitchType(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER)
{ {
if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]) if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
m_DeepFreeze = true; m_DeepFreeze = true;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER) else if(Collision()->GetSwitchType(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER)
{ {
if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]) if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
m_DeepFreeze = false; m_DeepFreeze = false;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_HAMMER && Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_HAMMER && Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{ {
m_Hit &= ~DISABLE_HIT_HAMMER; m_Hit &= ~DISABLE_HIT_HAMMER;
m_Core.m_NoHammerHit = false; m_Core.m_NoHammerHit = false;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_HAMMER) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_HAMMER) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{ {
m_Hit |= DISABLE_HIT_HAMMER; m_Hit |= DISABLE_HIT_HAMMER;
m_Core.m_NoHammerHit = true; m_Core.m_NoHammerHit = true;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_SHOTGUN && Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_SHOTGUN && Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{ {
m_Hit &= ~DISABLE_HIT_SHOTGUN; m_Hit &= ~DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = false; m_Core.m_NoShotgunHit = false;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_SHOTGUN) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_SHOTGUN) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{ {
m_Hit |= DISABLE_HIT_SHOTGUN; m_Hit |= DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = true; m_Core.m_NoShotgunHit = true;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_GRENADE && Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_GRENADE && Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{ {
m_Hit &= ~DISABLE_HIT_GRENADE; m_Hit &= ~DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = false; m_Core.m_NoGrenadeHit = false;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_GRENADE) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_GRENADE) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{ {
m_Hit |= DISABLE_HIT_GRENADE; m_Hit |= DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = true; m_Core.m_NoGrenadeHit = true;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_LASER && Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_LASER && Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{ {
m_Hit &= ~DISABLE_HIT_LASER; m_Hit &= ~DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = false; m_Core.m_NoLaserHit = false;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_LASER) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER) else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_LASER) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{ {
m_Hit |= DISABLE_HIT_LASER; m_Hit |= DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = true; m_Core.m_NoLaserHit = true;
} }
else if(Collision()->IsSwitch(MapIndex) == TILE_JUMP) else if(Collision()->GetSwitchType(MapIndex) == TILE_JUMP)
{ {
int newJumps = Collision()->GetSwitchDelay(MapIndex); int newJumps = Collision()->GetSwitchDelay(MapIndex);
if(newJumps != m_Core.m_Jumps) if(newJumps != m_Core.m_Jumps)

View file

@ -754,7 +754,7 @@ void CCollision::GetSpeedup(int Index, vec2 *Dir, int *Force, int *MaxSpeed) con
*MaxSpeed = m_pSpeedup[Index].m_MaxSpeed; *MaxSpeed = m_pSpeedup[Index].m_MaxSpeed;
} }
int CCollision::IsSwitch(int Index) const int CCollision::GetSwitchType(int Index) const
{ {
if(Index < 0 || !m_pSwitch) if(Index < 0 || !m_pSwitch)
return 0; return 0;

View file

@ -92,7 +92,7 @@ public:
int IsSpeedup(int Index) const; int IsSpeedup(int Index) const;
int IsTune(int Index) const; int IsTune(int Index) const;
void GetSpeedup(int Index, vec2 *Dir, int *Force, int *MaxSpeed) const; void GetSpeedup(int Index, vec2 *Dir, int *Force, int *MaxSpeed) const;
int IsSwitch(int Index) const; int GetSwitchType(int Index) const;
int GetSwitchNumber(int Index) const; int GetSwitchNumber(int Index) const;
int GetSwitchDelay(int Index) const; int GetSwitchDelay(int Index) const;

View file

@ -1716,46 +1716,46 @@ void CCharacter::HandleTiles(int Index)
m_Core.m_Vel = ClampVel(m_MoveRestrictions, m_Core.m_Vel); m_Core.m_Vel = ClampVel(m_MoveRestrictions, m_Core.m_Vel);
// handle switch tiles // handle switch tiles
if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SWITCHOPEN && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0) if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_SWITCHOPEN && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0)
{ {
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = true; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = true;
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = 0; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = 0;
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHOPEN; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHOPEN;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SWITCHTIMEDOPEN && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_SWITCHTIMEDOPEN && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0)
{ {
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = true; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = true;
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = Server()->Tick() + 1 + GameServer()->Collision()->GetSwitchDelay(MapIndex) * Server()->TickSpeed(); GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = Server()->Tick() + 1 + GameServer()->Collision()->GetSwitchDelay(MapIndex) * Server()->TickSpeed();
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHTIMEDOPEN; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHTIMEDOPEN;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SWITCHTIMEDCLOSE && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_SWITCHTIMEDCLOSE && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0)
{ {
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = false; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = false;
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = Server()->Tick() + 1 + GameServer()->Collision()->GetSwitchDelay(MapIndex) * Server()->TickSpeed(); GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = Server()->Tick() + 1 + GameServer()->Collision()->GetSwitchDelay(MapIndex) * Server()->TickSpeed();
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHTIMEDCLOSE; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHTIMEDCLOSE;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SWITCHCLOSE && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_SWITCHCLOSE && Team() != TEAM_SUPER && GameServer()->Collision()->GetSwitchNumber(MapIndex) > 0)
{ {
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = false; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()] = false;
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = 0; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_EndTick[Team()] = 0;
GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHCLOSE; GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Type[Team()] = TILE_SWITCHCLOSE;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_FREEZE && Team() != TEAM_SUPER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_FREEZE && Team() != TEAM_SUPER)
{ {
if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]) if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
Freeze(GameServer()->Collision()->GetSwitchDelay(MapIndex)); Freeze(GameServer()->Collision()->GetSwitchDelay(MapIndex));
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER)
{ {
if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]) if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
m_DeepFreeze = true; m_DeepFreeze = true;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER)
{ {
if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]) if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
m_DeepFreeze = false; m_DeepFreeze = false;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_HAMMER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_HAMMER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hammer hit others"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hammer hit others");
m_Hit &= ~DISABLE_HIT_HAMMER; m_Hit &= ~DISABLE_HIT_HAMMER;
@ -1763,7 +1763,7 @@ void CCharacter::HandleTiles(int Index)
m_Core.m_NoHammerHit = false; m_Core.m_NoHammerHit = false;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_HAMMER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_HAMMER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hammer hit others"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hammer hit others");
m_Hit |= DISABLE_HIT_HAMMER; m_Hit |= DISABLE_HIT_HAMMER;
@ -1771,43 +1771,43 @@ void CCharacter::HandleTiles(int Index)
m_Core.m_NoHammerHit = true; m_Core.m_NoHammerHit = true;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_SHOTGUN && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_SHOTGUN && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with shotgun"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with shotgun");
m_Hit &= ~DISABLE_HIT_SHOTGUN; m_Hit &= ~DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = false; m_Core.m_NoShotgunHit = false;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_SHOTGUN) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_SHOTGUN) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with shotgun"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with shotgun");
m_Hit |= DISABLE_HIT_SHOTGUN; m_Hit |= DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = true; m_Core.m_NoShotgunHit = true;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_GRENADE && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_GRENADE && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with grenade"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with grenade");
m_Hit &= ~DISABLE_HIT_GRENADE; m_Hit &= ~DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = false; m_Core.m_NoGrenadeHit = false;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_GRENADE) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_GRENADE) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with grenade"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with grenade");
m_Hit |= DISABLE_HIT_GRENADE; m_Hit |= DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = true; m_Core.m_NoGrenadeHit = true;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_LASER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_LASER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with laser"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with laser");
m_Hit &= ~DISABLE_HIT_LASER; m_Hit &= ~DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = false; m_Core.m_NoLaserHit = false;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_LASER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_LASER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{ {
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with laser"); GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with laser");
m_Hit |= DISABLE_HIT_LASER; m_Hit |= DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = true; m_Core.m_NoLaserHit = true;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_JUMP) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_JUMP)
{ {
int newJumps = GameServer()->Collision()->GetSwitchDelay(MapIndex); int newJumps = GameServer()->Collision()->GetSwitchDelay(MapIndex);
@ -1834,7 +1834,7 @@ void CCharacter::HandleTiles(int Index)
m_Core.m_Jumps = newJumps; m_Core.m_Jumps = newJumps;
} }
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ADD_TIME && !m_LastPenalty) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_ADD_TIME && !m_LastPenalty)
{ {
int min = GameServer()->Collision()->GetSwitchDelay(MapIndex); int min = GameServer()->Collision()->GetSwitchDelay(MapIndex);
int sec = GameServer()->Collision()->GetSwitchNumber(MapIndex); int sec = GameServer()->Collision()->GetSwitchNumber(MapIndex);
@ -1858,7 +1858,7 @@ void CCharacter::HandleTiles(int Index)
m_LastPenalty = true; m_LastPenalty = true;
} }
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SUBTRACT_TIME && !m_LastBonus) else if(GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_SUBTRACT_TIME && !m_LastBonus)
{ {
int min = GameServer()->Collision()->GetSwitchDelay(MapIndex); int min = GameServer()->Collision()->GetSwitchDelay(MapIndex);
int sec = GameServer()->Collision()->GetSwitchNumber(MapIndex); int sec = GameServer()->Collision()->GetSwitchNumber(MapIndex);
@ -1885,12 +1885,12 @@ void CCharacter::HandleTiles(int Index)
m_LastBonus = true; m_LastBonus = true;
} }
if(GameServer()->Collision()->IsSwitch(MapIndex) != TILE_ADD_TIME) if(GameServer()->Collision()->GetSwitchType(MapIndex) != TILE_ADD_TIME)
{ {
m_LastPenalty = false; m_LastPenalty = false;
} }
if(GameServer()->Collision()->IsSwitch(MapIndex) != TILE_SUBTRACT_TIME) if(GameServer()->Collision()->GetSwitchType(MapIndex) != TILE_SUBTRACT_TIME)
{ {
m_LastBonus = false; m_LastBonus = false;
} }
@ -2108,7 +2108,7 @@ void CCharacter::DDRaceTick()
const int aTiles[] = { const int aTiles[] = {
GameServer()->Collision()->GetTileIndex(Index), GameServer()->Collision()->GetTileIndex(Index),
GameServer()->Collision()->GetFTileIndex(Index), GameServer()->Collision()->GetFTileIndex(Index),
GameServer()->Collision()->IsSwitch(Index)}; GameServer()->Collision()->GetSwitchType(Index)};
if(IsGrounded() && !m_DeepFreeze) if(IsGrounded() && !m_DeepFreeze)
{ {
bool IsInFreeze = false; bool IsInFreeze = false;

View file

@ -193,8 +193,8 @@ void CLaser::DoBounce()
{ {
int MapIndex = GameServer()->Collision()->GetPureMapIndex(Coltile); int MapIndex = GameServer()->Collision()->GetPureMapIndex(Coltile);
int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex); int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex);
bool IsSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_TELE_GUN; bool IsSwitchTeleGun = GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_ALLOW_TELE_GUN;
bool IsBlueSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_BLUE_TELE_GUN; bool IsBlueSwitchTeleGun = GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_ALLOW_BLUE_TELE_GUN;
int IsTeleInWeapon = GameServer()->Collision()->IsTeleportWeapon(MapIndex); int IsTeleInWeapon = GameServer()->Collision()->IsTeleportWeapon(MapIndex);
if(!IsTeleInWeapon) if(!IsTeleInWeapon)

View file

@ -179,8 +179,8 @@ void CProjectile::Tick()
{ {
int MapIndex = GameServer()->Collision()->GetPureMapIndex(pTargetChr ? pTargetChr->m_Pos : ColPos); int MapIndex = GameServer()->Collision()->GetPureMapIndex(pTargetChr ? pTargetChr->m_Pos : ColPos);
int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex); int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex);
bool IsSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_TELE_GUN; bool IsSwitchTeleGun = GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_ALLOW_TELE_GUN;
bool IsBlueSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_BLUE_TELE_GUN; bool IsBlueSwitchTeleGun = GameServer()->Collision()->GetSwitchType(MapIndex) == TILE_ALLOW_BLUE_TELE_GUN;
if(IsSwitchTeleGun || IsBlueSwitchTeleGun) if(IsSwitchTeleGun || IsBlueSwitchTeleGun)
{ {