mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix showothers for specchar
This commit is contained in:
parent
8c8f292b52
commit
eb1779f58c
|
@ -177,7 +177,9 @@ void CNamePlates::OnRender()
|
|||
|
||||
if(m_pClient->m_aClients[i].m_SpecCharPresent)
|
||||
{
|
||||
RenderNameplatePos(m_pClient->m_aClients[i].m_SpecChar, pInfo, 0.4f);
|
||||
bool OtherTeam = m_pClient->IsOtherTeam(i);
|
||||
float Alpha = 0.4f * (OtherTeam ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f);
|
||||
RenderNameplatePos(m_pClient->m_aClients[i].m_SpecChar, pInfo, Alpha);
|
||||
}
|
||||
|
||||
// only render active characters
|
||||
|
|
|
@ -675,8 +675,10 @@ void CPlayers::OnRender()
|
|||
{
|
||||
continue;
|
||||
}
|
||||
bool OtherTeam = m_pClient->IsOtherTeam(i);
|
||||
float Alpha = OtherTeam ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f;
|
||||
vec2 Pos = m_pClient->m_aClients[i].m_SpecChar;
|
||||
RenderTools()->RenderTee(CAnimState::GetIdle(), &m_RenderInfoSpec, EMOTE_BLINK, vec2(1, 0), Pos, 1.0f);
|
||||
RenderTools()->RenderTee(CAnimState::GetIdle(), &m_RenderInfoSpec, EMOTE_BLINK, vec2(1, 0), Pos, Alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -404,7 +404,19 @@ void CPlayer::Snap(int SnappingClient)
|
|||
pRaceInfo->m_RaceStartTick = m_pCharacter->m_StartTime;
|
||||
}
|
||||
|
||||
if(m_pCharacter && m_pCharacter->IsPaused())
|
||||
bool ShowSpec = m_pCharacter && m_pCharacter->IsPaused();
|
||||
|
||||
if(SnappingClient >= 0)
|
||||
{
|
||||
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
|
||||
ShowSpec = ShowSpec && (
|
||||
GameServer()->GetDDRaceTeam(id) == GameServer()->GetDDRaceTeam(SnappingClient)
|
||||
|| pSnapPlayer->m_ShowOthers
|
||||
|| (pSnapPlayer->GetTeam() == TEAM_SPECTATORS || pSnapPlayer->IsPaused())
|
||||
);
|
||||
}
|
||||
|
||||
if(ShowSpec)
|
||||
{
|
||||
CNetObj_SpecChar *pSpecChar = static_cast<CNetObj_SpecChar *>(Server()->SnapNewItem(NETOBJTYPE_SPECCHAR, id, sizeof(CNetObj_SpecChar)));
|
||||
pSpecChar->m_X = m_pCharacter->Core()->m_Pos.x;
|
||||
|
|
Loading…
Reference in a new issue