This commit is contained in:
heinrich5991 2024-03-12 08:54:50 +01:00 committed by GitHub
commit 06b7ac90bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 8 deletions

View file

@ -822,9 +822,9 @@ bool CCollision::TileExists(int Index) const
if(Index < 0)
return false;
if((m_pTiles[Index].m_Index >= TILE_FREEZE && m_pTiles[Index].m_Index <= TILE_TELE_LASER_DISABLE) || (m_pTiles[Index].m_Index >= TILE_LFREEZE && m_pTiles[Index].m_Index <= TILE_LUNFREEZE))
if(m_pTiles[Index].m_Index == TILE_DEATH || (m_pTiles[Index].m_Index >= TILE_FREEZE && m_pTiles[Index].m_Index <= TILE_TELE_LASER_DISABLE) || (m_pTiles[Index].m_Index >= TILE_LFREEZE && m_pTiles[Index].m_Index <= TILE_LUNFREEZE))
return true;
if(m_pFront && ((m_pFront[Index].m_Index >= TILE_FREEZE && m_pFront[Index].m_Index <= TILE_TELE_LASER_DISABLE) || (m_pFront[Index].m_Index >= TILE_LFREEZE && m_pFront[Index].m_Index <= TILE_LUNFREEZE)))
if(m_pFront && (m_pFront[Index].m_Index == TILE_DEATH || (m_pFront[Index].m_Index >= TILE_FREEZE && m_pFront[Index].m_Index <= TILE_TELE_LASER_DISABLE) || (m_pFront[Index].m_Index >= TILE_LFREEZE && m_pFront[Index].m_Index <= TILE_LUNFREEZE)))
return true;
if(m_pTele && (m_pTele[Index].m_Type == TILE_TELEIN || m_pTele[Index].m_Type == TILE_TELEINEVIL || m_pTele[Index].m_Type == TILE_TELECHECKINEVIL || m_pTele[Index].m_Type == TILE_TELECHECK || m_pTele[Index].m_Type == TILE_TELECHECKIN))
return true;

View file

@ -1458,13 +1458,14 @@ void CCharacter::SetTimeCheckpoint(int TimeCheckpoint)
}
}
void CCharacter::HandleTiles(int Index)
void CCharacter::HandleTiles(int Index, bool *pStopProcessing)
{
int MapIndex = Index;
//int PureMapIndex = Collision()->GetPureMapIndex(m_Pos);
m_TileIndex = Collision()->GetTileIndex(MapIndex);
m_TileFIndex = Collision()->GetFTileIndex(MapIndex);
m_MoveRestrictions = Collision()->GetMoveRestrictions(IsSwitchActiveCb, this, m_Pos, 18.0f, MapIndex);
*pStopProcessing = false;
if(Index < 0)
{
m_LastRefillJumps = false;
@ -1833,6 +1834,13 @@ void CCharacter::HandleTiles(int Index)
m_LastBonus = false;
}
if((m_TileIndex == TILE_DEATH) || (m_TileFIndex == TILE_DEATH))
{
Die(m_pPlayer->GetCID(), WEAPON_WORLD);
*pStopProcessing = true;
return;
}
int z = Collision()->IsTeleport(MapIndex);
if(!g_Config.m_SvOldTeleportHook && !g_Config.m_SvOldTeleportWeapons && z && !(*m_pTeleOuts)[z - 1].empty())
{
@ -1840,6 +1848,7 @@ void CCharacter::HandleTiles(int Index)
return;
int TeleOut = GameWorld()->m_Core.RandomOr0((*m_pTeleOuts)[z - 1].size());
m_Core.m_Pos = (*m_pTeleOuts)[z - 1][TeleOut];
*pStopProcessing = true;
if(!g_Config.m_SvTeleportHoldHook)
{
ResetHook();
@ -1855,6 +1864,7 @@ void CCharacter::HandleTiles(int Index)
return;
int TeleOut = GameWorld()->m_Core.RandomOr0((*m_pTeleOuts)[evilz - 1].size());
m_Core.m_Pos = (*m_pTeleOuts)[evilz - 1][TeleOut];
*pStopProcessing = true;
if(!g_Config.m_SvOldTeleportHook && !g_Config.m_SvOldTeleportWeapons)
{
m_Core.m_Vel = vec2(0, 0);
@ -1882,6 +1892,7 @@ void CCharacter::HandleTiles(int Index)
{
int TeleOut = GameWorld()->m_Core.RandomOr0((*m_pTeleCheckOuts)[k].size());
m_Core.m_Pos = (*m_pTeleCheckOuts)[k][TeleOut];
*pStopProcessing = true;
m_Core.m_Vel = vec2(0, 0);
if(!g_Config.m_SvTeleportHoldHook)
@ -1898,6 +1909,7 @@ void CCharacter::HandleTiles(int Index)
if(GameServer()->m_pController->CanSpawn(m_pPlayer->GetTeam(), &SpawnPos, GameServer()->GetDDRaceTeam(GetPlayer()->GetCid())))
{
m_Core.m_Pos = SpawnPos;
*pStopProcessing = true;
m_Core.m_Vel = vec2(0, 0);
if(!g_Config.m_SvTeleportHoldHook)
@ -1919,6 +1931,7 @@ void CCharacter::HandleTiles(int Index)
{
int TeleOut = GameWorld()->m_Core.RandomOr0((*m_pTeleCheckOuts)[k].size());
m_Core.m_Pos = (*m_pTeleCheckOuts)[k][TeleOut];
*pStopProcessing = true;
if(!g_Config.m_SvTeleportHoldHook)
{
@ -1933,6 +1946,7 @@ void CCharacter::HandleTiles(int Index)
if(GameServer()->m_pController->CanSpawn(m_pPlayer->GetTeam(), &SpawnPos, GameServer()->GetDDRaceTeam(GetPlayer()->GetCid())))
{
m_Core.m_Pos = SpawnPos;
*pStopProcessing = true;
if(!g_Config.m_SvTeleportHoldHook)
{
@ -2142,16 +2156,22 @@ void CCharacter::DDRacePostCoreTick()
{
for(int &Index : vIndices)
{
HandleTiles(Index);
if(!m_Alive)
bool StopProcessing;
HandleTiles(Index, &StopProcessing);
if(StopProcessing || !m_Alive)
{
return;
}
}
}
else
{
HandleTiles(CurrentIndex);
if(!m_Alive)
bool StopProcessing;
HandleTiles(CurrentIndex, &StopProcessing);
if(StopProcessing || !m_Alive)
{
return;
}
}
// teleport gun

View file

@ -160,7 +160,7 @@ private:
void SnapCharacter(int SnappingClient, int Id);
static bool IsSwitchActiveCb(int Number, void *pUser);
void SetTimeCheckpoint(int TimeCheckpoint);
void HandleTiles(int Index);
void HandleTiles(int Index, bool *pStopProcessing);
float m_Time;
int m_LastBroadcast;
void DDRaceInit();