mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
added high sensitivity for Begin and End tiles
This commit is contained in:
parent
27864ec70d
commit
50b16e7821
|
@ -598,6 +598,7 @@ void CCharacter::OnFinish()
|
|||
{
|
||||
//TODO: this ugly
|
||||
float time = (float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed());
|
||||
if(time < 0.000001) return;
|
||||
CPlayerData *pData = GameServer()->Score()->PlayerData(m_pPlayer->GetCID());
|
||||
char aBuf[128];
|
||||
m_CpActive=-2;
|
||||
|
@ -925,6 +926,19 @@ void CCharacter::HandleTiles(int Index)
|
|||
m_TileSFlagsB = GameServer()->Collision()->GetDTileFlags(MapIndexB, Team());
|
||||
m_TileSIndexT = GameServer()->Collision()->GetDTileIndex(MapIndexT, Team());
|
||||
m_TileSFlagsT = GameServer()->Collision()->GetDTileFlags(MapIndexT, Team());
|
||||
//Sensitivity
|
||||
int S1 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x+m_ProximityRadius/3.f, m_Pos.y-m_ProximityRadius/3.f));
|
||||
int S2 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x+m_ProximityRadius/3.f, m_Pos.y+m_ProximityRadius/3.f));
|
||||
int S3 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x-m_ProximityRadius/3.f, m_Pos.y-m_ProximityRadius/3.f));
|
||||
int S4 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x-m_ProximityRadius/3.f, m_Pos.y+m_ProximityRadius/3.f));
|
||||
int Tile1 = GameServer()->Collision()->GetTileIndex(S1);
|
||||
int Tile2 = GameServer()->Collision()->GetTileIndex(S2);
|
||||
int Tile3 = GameServer()->Collision()->GetTileIndex(S3);
|
||||
int Tile4 = GameServer()->Collision()->GetTileIndex(S4);
|
||||
int FTile1 = GameServer()->Collision()->GetFTileIndex(S1);
|
||||
int FTile2 = GameServer()->Collision()->GetFTileIndex(S2);
|
||||
int FTile3 = GameServer()->Collision()->GetFTileIndex(S3);
|
||||
int FTile4 = GameServer()->Collision()->GetFTileIndex(S4);
|
||||
//dbg_msg("","N%d L%d R%d B%d T%d",m_TileIndex,m_TileIndexL,m_TileIndexR,m_TileIndexB,m_TileIndexT);
|
||||
//dbg_msg("","N%d L%d R%d B%d T%d",m_TileFIndex,m_TileFIndexL,m_TileFIndexR,m_TileFIndexB,m_TileFIndexT);
|
||||
|
||||
|
@ -942,7 +956,7 @@ void CCharacter::HandleTiles(int Index)
|
|||
m_CpCurrent[cpf] = m_Time;
|
||||
m_CpTick = Server()->Tick() + Server()->TickSpeed()*2;
|
||||
}
|
||||
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN)) && (m_DDRaceState == DDRACE_NONE || (m_DDRaceState == DDRACE_STARTED && !Team())))
|
||||
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN) || FTile1 == TILE_BEGIN || FTile2 == TILE_BEGIN || FTile3 == TILE_BEGIN || FTile4 == TILE_BEGIN || Tile1 == TILE_BEGIN || Tile2 == TILE_BEGIN || Tile3 == TILE_BEGIN || Tile4 == TILE_BEGIN) && (m_DDRaceState == DDRACE_NONE || (m_DDRaceState == DDRACE_STARTED && !Team())))
|
||||
{
|
||||
bool CanBegin = true;
|
||||
if(g_Config.m_SvTeam == 1 && (Team() == TEAM_FLOCK || Teams()->Count(Team()) <= 1) ) {
|
||||
|
@ -957,8 +971,7 @@ void CCharacter::HandleTiles(int Index)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END)) && m_DDRaceState == DDRACE_STARTED)
|
||||
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END) || FTile1 == TILE_END || FTile2 == TILE_END || FTile3 == TILE_END || FTile4 == TILE_END || Tile1 == TILE_END || Tile2 == TILE_END || Tile3 == TILE_END || Tile4 == TILE_END) && m_DDRaceState == DDRACE_STARTED)
|
||||
{
|
||||
Controller->m_Teams.OnCharacterFinish(m_pPlayer->GetCID());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue