diff --git a/data/editor/entities.png b/data/editor/entities.png index 05918d24b..f0608a8da 100644 Binary files a/data/editor/entities.png and b/data/editor/entities.png differ diff --git a/data/editor/entities_clear.png b/data/editor/entities_clear.png index 8c3b9aa11..d9d09d44c 100644 Binary files a/data/editor/entities_clear.png and b/data/editor/entities_clear.png differ diff --git a/data/editor/tele.png b/data/editor/tele.png index 29ec67d31..5a046fb0b 100644 Binary files a/data/editor/tele.png and b/data/editor/tele.png differ diff --git a/data/skins/Kirby.png b/data/skins/Kirby.png new file mode 100644 index 000000000..e57c792a6 Binary files /dev/null and b/data/skins/Kirby.png differ diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 06e5f99e1..c07cea954 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2023,7 +2023,7 @@ void CClient::Run() Update(); - if(!g_Config.m_GfxAsyncRender || m_pGraphics->IsIdle()) + if(m_pGraphics->WindowOpen() && (!g_Config.m_GfxAsyncRender || m_pGraphics->IsIdle())) { m_RenderFrames++; diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 448c9a562..b39b7360d 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -206,6 +206,7 @@ MACRO_CONFIG_INT(ClBackgroundEntitiesSat, cl_background_entities_sat, 0, 0, 255, MACRO_CONFIG_INT(ClBackgroundEntitiesLht, cl_background_entities_lht, 128, 0, 255, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Background (entities) color lightness") MACRO_CONFIG_INT(SvShowOthers, sv_show_others, 1, 0, 1, CFGFLAG_SERVER, "Whether players can user the command showothers or not") MACRO_CONFIG_INT(SvShowOthersDefault, sv_show_others_default, 0, 0, 1, CFGFLAG_SERVER, "Whether players see others by default") +MACRO_CONFIG_INT(SvShowAllDefault, sv_show_all_default, 0, 0, 1, CFGFLAG_SERVER, "Whether players see all tees by default") MACRO_CONFIG_INT(SvMaxAfkTime, sv_max_afk_time, 0, 0, 9999, CFGFLAG_SERVER, "The time in seconds a player is allowed to be afk (0 = disabled)") MACRO_CONFIG_INT(SvMaxAfkVoteTime, sv_max_afk_vote_time, 300, 0, 9999, CFGFLAG_SERVER, "The time in seconds a player can be afk and his votes still count (0 = disabled)") MACRO_CONFIG_INT(SvPlasmaRange, sv_plasma_range, 700, 1, 99999, CFGFLAG_SERVER, "How far will the plasma gun track tees") diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index f3a6dfbd6..a3624dcaa 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -181,20 +181,20 @@ void CMenus::RenderPlayers(CUIRect MainView) continue; int Index = m_pClient->m_Snap.m_paInfoByTeam[i]->m_ClientID; - CListboxItem Item = UiDoListboxNextItem(&m_pClient->m_aClients[Index]); if(Index == m_pClient->m_Snap.m_LocalClientID) continue; + CListboxItem Item = UiDoListboxNextItem(&m_pClient->m_aClients[Index]); + Count++; if(!Item.m_Visible) continue; - Item.m_Rect.HSplitTop(24.0f, &ButtonBar, &Item.m_Rect); if(Count%2 == 1) - RenderTools()->DrawUIRect(&ButtonBar, vec4(1.0f, 1.0f, 1.0f, 0.25f), CUI::CORNER_ALL, 10.0f); - ButtonBar.VSplitRight(200.0f, &Player, &ButtonBar); + RenderTools()->DrawUIRect(&Item.m_Rect, vec4(1.0f, 1.0f, 1.0f, 0.25f), CUI::CORNER_ALL, 10.0f); + Item.m_Rect.VSplitRight(200.0f, &Player, &Item.m_Rect); // player info Player.VSplitLeft(28.0f, &Button, &Player); @@ -214,8 +214,8 @@ void CMenus::RenderPlayers(CUIRect MainView) TextRender()->TextEx(&Cursor, m_pClient->m_aClients[Index].m_aClan, -1); // ignore button - ButtonBar.HMargin(2.0f, &ButtonBar); - ButtonBar.VSplitLeft(Width, &Button, &ButtonBar); + Item.m_Rect.HMargin(2.0f, &Item.m_Rect); + Item.m_Rect.VSplitLeft(Width, &Button, &Item.m_Rect); Button.VSplitLeft((Width-Button.h)/4.0f, 0, &Button); Button.VSplitLeft(Button.h, &Button, 0); if(g_Config.m_ClShowChatFriends && !m_pClient->m_aClients[Index].m_Friend) @@ -225,8 +225,8 @@ void CMenus::RenderPlayers(CUIRect MainView) m_pClient->m_aClients[Index].m_ChatIgnore ^= 1; // friend button - ButtonBar.VSplitLeft(20.0f, &Button, &ButtonBar); - ButtonBar.VSplitLeft(Width, &Button, &ButtonBar); + Item.m_Rect.VSplitLeft(20.0f, &Button, &Item.m_Rect); + Item.m_Rect.VSplitLeft(Width, &Button, &Item.m_Rect); Button.VSplitLeft((Width-Button.h)/4.0f, 0, &Button); Button.VSplitLeft(Button.h, &Button, 0); if(DoButton_Toggle(&s_aPlayerIDs[Index][1], m_pClient->m_aClients[Index].m_Friend, &Button, true)) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index d05ff178c..2156b9f9f 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -273,7 +273,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch { LineHeight = 50.0f; TeeSizeMod = 0.9f; - Spacing = 8.0f; + Spacing = 5.0f; RoundRadius = 15.0f; } @@ -359,10 +359,8 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch { Graphics()->TextureSet(-1); Graphics()->QuadsBegin(); - float r = (DDTeam % 22) / 22.0f; - float g = ((DDTeam - 22) % 22) / 22.0f; - float b = ((DDTeam - 44) % 22) / 22.0f; - Graphics()->SetColor(r, g, b, 0.5f); + vec3 rgb = HslToRgb(vec3(DDTeam / 64.0f, 1.0f, 0.5f)); + Graphics()->SetColor(rgb.r, rgb.g, rgb.b, 0.5f); int Corners = 0; diff --git a/src/game/collision.cpp b/src/game/collision.cpp index fecc75a32..6dad5f361 100644 --- a/src/game/collision.cpp +++ b/src/game/collision.cpp @@ -526,6 +526,19 @@ int CCollision::IsCheckTeleport(int Index) return 0; } +int CCollision::IsCheckEvilTeleport(int Index) +{ + if(Index < 0) + return 0; + if(!m_pTele) + return 0; + + if(m_pTele[Index].m_Type == TILE_TELECHECKINEVIL) + return m_pTele[Index].m_Number; + + return 0; +} + int CCollision::IsTCheckpoint(int Index) { if(Index < 0) @@ -684,7 +697,7 @@ bool CCollision::TileExists(int Index) return true; if(m_pFront && m_pFront[Index].m_Index >= TILE_FREEZE && m_pFront[Index].m_Index <= TILE_NPH_START) 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_TELECHECK || m_pTele[Index].m_Type == TILE_TELECHECKIN)) + 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; if(m_pSpeedup && m_pSpeedup[Index].m_Force > 0) return true; diff --git a/src/game/collision.h b/src/game/collision.h index 55f16a236..68b91b33f 100644 --- a/src/game/collision.h +++ b/src/game/collision.h @@ -78,6 +78,7 @@ public: int IsTeleport(int Index); int IsEvilTeleport(int Index); int IsCheckTeleport(int Index); + int IsCheckEvilTeleport(int Index); int IsTeleportWeapon(int Index); int IsTeleportHook(int Index); int IsTCheckpoint(int Index); diff --git a/src/game/ddracecommands.h b/src/game/ddracecommands.h index 883bf3eae..5e6ac0c14 100644 --- a/src/game/ddracecommands.h +++ b/src/game/ddracecommands.h @@ -31,7 +31,8 @@ CONSOLE_COMMAND("move", "ii", CFGFLAG_SERVER|CMDFLAG_TEST, ConMove, this, "Moves CONSOLE_COMMAND("move_raw", "ii", CFGFLAG_SERVER|CMDFLAG_TEST, ConMoveRaw, this, "Moves to the point with x/y-coordinates ii") CONSOLE_COMMAND("force_pause", "ii", CFGFLAG_SERVER, ConForcePause, this, "Force i to pause for i seconds") CONSOLE_COMMAND("force_unpause", "i", CFGFLAG_SERVER, ConForcePause, this, "Set force-pause timer of v to 0.") -CONSOLE_COMMAND("showothers", "?i", CFGFLAG_CHAT, ConShowOthers, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on") +CONSOLE_COMMAND("showothers", "?i", CFGFLAG_CHAT, ConShowOthers, this, "Whether to show players from other teams or not (off by default), optional i = 0 for off else for on") +CONSOLE_COMMAND("showall", "?i", CFGFLAG_CHAT, ConShowAll, this, "Whether to show players at any distance (off by default), optional i = 0 for off else for on") CONSOLE_COMMAND("list", "?s", CFGFLAG_CHAT, ConList, this, "List connected players with optional case-insensitive substring matching filter") diff --git a/src/game/editor/io.cpp b/src/game/editor/io.cpp index e06db4150..67c43ffb7 100644 --- a/src/game/editor/io.cpp +++ b/src/game/editor/io.cpp @@ -709,6 +709,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag ((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELECHECK; else if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELECHECKIN) ((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELECHECKIN; + else if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELECHECKINEVIL) + ((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELECHECKINEVIL; else if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELECHECKOUT) ((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELECHECKOUT; else if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELEINWEAPON) diff --git a/src/game/editor/layer_tiles.cpp b/src/game/editor/layer_tiles.cpp index badac3f78..493248594 100644 --- a/src/game/editor/layer_tiles.cpp +++ b/src/game/editor/layer_tiles.cpp @@ -180,7 +180,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect) for(int x = 0; x < r.w; x++) { pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x] = ((CLayerTele*)this)->m_pTeleTile[(r.y+y)*m_Width+(r.x+x)]; - if(pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEIN || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEOUT || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINEVIL || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECK || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECKOUT || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECKIN || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINWEAPON || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINHOOK) + if(pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEIN || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEOUT || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINEVIL || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECKINEVIL || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECK || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECKOUT || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELECHECKIN || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINWEAPON || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINHOOK) m_pEditor->m_TeleNumber = pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Number; } pGrabbed->m_TeleNum = m_pEditor->m_TeleNumber; @@ -762,7 +762,7 @@ void CLayerTele::BrushDraw(CLayer *pBrush, float wx, float wy) if(fx<0 || fx >= m_Width || fy < 0 || fy >= m_Height) continue; - if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECK || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECKOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECKIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINWEAPON || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINHOOK) + if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECKINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECK || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECKOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELECHECKIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINWEAPON || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINHOOK) { if(m_pEditor->m_TeleNumber != l->m_TeleNum) { diff --git a/src/game/mapitems.h b/src/game/mapitems.h index 6624fc5d9..1d8887911 100644 --- a/src/game/mapitems.h +++ b/src/game/mapitems.h @@ -123,6 +123,7 @@ enum TILE_STOP = 60, TILE_STOPS, TILE_STOPA, + TILE_TELECHECKINEVIL = 63, TILE_CP = 64, TILE_CP_F, TILE_OLDLASER = 71, diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index c4c96ecb2..67fea0725 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -12,7 +12,6 @@ #endif bool CheckClientID(int ClientID); -char* TimerType(int TimerType); void CGameContext::ConCredits(IConsole::IResult *pResult, void *pUserData) { @@ -898,6 +897,22 @@ void CGameContext::ConShowOthers(IConsole::IResult *pResult, void *pUserData) "Showing players from other teams is disabled by the server admin"); } +void CGameContext::ConShowAll(IConsole::IResult *pResult, void *pUserData) +{ + CGameContext *pSelf = (CGameContext *) pUserData; + if (!CheckClientID(pResult->m_ClientID)) + return; + + CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID]; + if (!pPlayer) + return; + + if (pResult->NumArguments()) + pPlayer->m_ShowAll = pResult->GetInteger(0); + else + pPlayer->m_ShowAll = !pPlayer->m_ShowAll; +} + bool CheckClientID(int ClientID) { dbg_assert(ClientID >= 0 || ClientID < MAX_CLIENTS, @@ -907,11 +922,6 @@ bool CheckClientID(int ClientID) return true; } -char* TimerType(int TimerType) -{ - char msg[3][128] = {"game/round timer.", "broadcast.", "both game/round timer and broadcast."}; - return msg[TimerType]; -} void CGameContext::ConSayTime(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *) pUserData; @@ -995,9 +1005,10 @@ void CGameContext::ConSetTimerType(IConsole::IResult *pResult, void *pUserData) if (!pPlayer) return; + const char msg[3][128] = {"game/round timer.", "broadcast.", "both game/round timer and broadcast."}; char aBuf[128]; if(pPlayer->m_TimerType <= 2 && pPlayer->m_TimerType >= 0) - str_format(aBuf, sizeof(aBuf), "Timer is displayed in", TimerType(pPlayer->m_TimerType)); + str_format(aBuf, sizeof(aBuf), "Timer is displayed in", msg[pPlayer->m_TimerType]); else if(pPlayer->m_TimerType == 3) str_format(aBuf, sizeof(aBuf), "Timer isn't displayed."); diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 9d467dd76..3f2ab6a39 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -1048,6 +1048,17 @@ int CCharacter::NetworkClipped(int SnappingClient) int CCharacter::NetworkClipped(int SnappingClient, vec2 CheckPos) { + if(SnappingClient == -1 || GameServer()->m_apPlayers[SnappingClient]->m_ShowAll) + return 0; + + float dx = GameServer()->m_apPlayers[SnappingClient]->m_ViewPos.x-CheckPos.x; + float dy = GameServer()->m_apPlayers[SnappingClient]->m_ViewPos.y-CheckPos.y; + + if(absolute(dx) > 1000.0f || absolute(dy) > 800.0f) + return 1; + + if(distance(GameServer()->m_apPlayers[SnappingClient]->m_ViewPos, CheckPos) > 4000.0f) + return 1; return 0; } @@ -1107,13 +1118,18 @@ void CCharacter::HandleSkippableTiles(int Index) GameServer()->Collision()->GetFCollisionAt(m_Pos.x+m_ProximityRadius/3.f, m_Pos.y-m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH || GameServer()->Collision()->GetFCollisionAt(m_Pos.x+m_ProximityRadius/3.f, m_Pos.y+m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH || GameServer()->Collision()->GetFCollisionAt(m_Pos.x-m_ProximityRadius/3.f, m_Pos.y-m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH || - GameServer()->Collision()->GetCollisionAt(m_Pos.x-m_ProximityRadius/3.f, m_Pos.y+m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH || - GameLayerClipped(m_Pos)) && + GameServer()->Collision()->GetCollisionAt(m_Pos.x-m_ProximityRadius/3.f, m_Pos.y+m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH) && !m_Super && !(Team() && Teams()->TeeFinished(m_pPlayer->GetCID()))) - { - Die(m_pPlayer->GetCID(), WEAPON_WORLD); - return; - } + { + Die(m_pPlayer->GetCID(), WEAPON_WORLD); + return; + } + + if (GameLayerClipped(m_Pos) && !(Team() && Teams()->TeeFinished(m_pPlayer->GetCID()))) + { + Die(m_pPlayer->GetCID(), WEAPON_WORLD); + return; + } if(Index < 0) return; @@ -1569,6 +1585,42 @@ void CCharacter::HandleTiles(int Index) } return; } + if(GameServer()->Collision()->IsCheckEvilTeleport(MapIndex)) + { + if (m_Super) + return; + // first check if there is a TeleCheckOut for the current recorded checkpoint, if not check previous checkpoints + for(int k=m_TeleCheckpoint-1; k >= 0; k--) + { + if(Controller->m_TeleCheckOuts[k].size()) + { + m_Core.m_HookedPlayer = -1; + m_Core.m_HookState = HOOK_RETRACTED; + m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT; + m_Core.m_HookState = HOOK_RETRACTED; + int Num = Controller->m_TeleCheckOuts[k].size(); + m_Core.m_Pos = Controller->m_TeleCheckOuts[k][(!Num)?Num:rand() % Num]; + GameWorld()->ReleaseHooked(GetPlayer()->GetCID()); + m_Core.m_Vel = vec2(0,0); + m_Core.m_HookPos = m_Core.m_Pos; + return; + } + } + // if no checkpointout have been found (or if there no recorded checkpoint), teleport to start + vec2 SpawnPos; + if(GameServer()->m_pController->CanSpawn(m_pPlayer->GetTeam(), &SpawnPos)) + { + m_Core.m_HookedPlayer = -1; + m_Core.m_HookState = HOOK_RETRACTED; + m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT; + m_Core.m_HookState = HOOK_RETRACTED; + m_Core.m_Pos = SpawnPos; + GameWorld()->ReleaseHooked(GetPlayer()->GetCID()); + m_Core.m_Vel = vec2(0,0); + m_Core.m_HookPos = m_Core.m_Pos; + } + return; + } if(GameServer()->Collision()->IsCheckTeleport(MapIndex)) { if (m_Super) diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index 180c0c3de..ddf2159f4 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -262,6 +262,7 @@ private: static void ConToggleBroadcast(IConsole::IResult *pResult, void *pUserData); static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData); static void ConShowOthers(IConsole::IResult *pResult, void *pUserData); + static void ConShowAll(IConsole::IResult *pResult, void *pUserData); static void ConNinjaJetpack(IConsole::IResult *pResult, void *pUserData); static void ConSayTime(IConsole::IResult *pResult, void *pUserData); static void ConSayTimeAll(IConsole::IResult *pResult, void *pUserData); diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 44e05c49d..4c1f14daf 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -75,6 +75,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team) m_ClientVersion = VERSION_VANILLA; m_ShowOthers = g_Config.m_SvShowOthersDefault; + m_ShowAll = g_Config.m_SvShowAllDefault; m_NinjaJetpack = false; m_Paused = PAUSED_NONE; @@ -300,7 +301,7 @@ void CPlayer::OnDisconnect(const char *pReason) } CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController; - Controller->m_Teams.m_Core.Team(m_ClientID, 0); + Controller->m_Teams.SetForceCharacterTeam(m_ClientID, 0); } void CPlayer::OnPredictedInput(CNetObj_PlayerInput *NewInput) diff --git a/src/game/server/player.h b/src/game/server/player.h index 220095e71..86305f9de 100644 --- a/src/game/server/player.h +++ b/src/game/server/player.h @@ -139,6 +139,7 @@ public: int m_Authed; int m_ClientVersion; bool m_ShowOthers; + bool m_ShowAll; bool m_NinjaJetpack; bool m_Afk; diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index ce3a5b491..b968179b3 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -314,27 +314,13 @@ void CGameTeams::SendTeamsState(int ClientID) if (g_Config.m_SvTeam == 3) return; - if (!m_pGameContext->m_apPlayers[ClientID] || m_pGameContext->m_apPlayers[ClientID]->m_ClientVersion < VERSION_DDRACE) + if (!m_pGameContext->m_apPlayers[ClientID] || m_pGameContext->m_apPlayers[ClientID]->m_ClientVersion <= VERSION_DDRACE) return; CMsgPacker Msg(NETMSGTYPE_SV_TEAMSSTATE); - if (m_pGameContext->m_apPlayers[ClientID]->m_ClientVersion == VERSION_DDRACE) - { - for(unsigned i = 0; i < VANILLA_MAX_CLIENTS; i++) - { - int target = 0; - Server()->ReverseTranslate(target, i); - Msg.AddInt(m_Core.Team(target)); - } - } - else - { - for(unsigned i = 0; i < MAX_CLIENTS; i++) - { - Msg.AddInt(m_Core.Team(i)); - } - } + for(unsigned i = 0; i < MAX_CLIENTS; i++) + Msg.AddInt(m_Core.Team(i)); Server()->SendMsg(&Msg, MSGFLAG_VITAL, ClientID); }