mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Fixed the bugs i know of with the last few commits
This commit is contained in:
parent
2baa440866
commit
7d462b565d
|
@ -203,7 +203,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
||||||
Spacing = 8.0f;
|
Spacing = 8.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float ScoreOffset = x+10.0f, ScoreLength = TextRender()->TextWidth(0, 22.0f/*HeadlineFontsize*/, Localize("00:00.00"), -1);
|
float ScoreOffset = x+10.0f, ScoreLength = TextRender()->TextWidth(0, 22.0f/*HeadlineFontsize*/, "00:00:0", -1);
|
||||||
float TeeOffset = ScoreOffset+ScoreLength, TeeLength = 60*TeeSizeMod;
|
float TeeOffset = ScoreOffset+ScoreLength, TeeLength = 60*TeeSizeMod;
|
||||||
float NameOffset = TeeOffset+TeeLength, NameLength = 300.0f-TeeLength;
|
float NameOffset = TeeOffset+TeeLength, NameLength = 300.0f-TeeLength;
|
||||||
float PingOffset = x+610.0f, PingLength = 65.0f;
|
float PingOffset = x+610.0f, PingLength = 65.0f;
|
||||||
|
@ -250,9 +250,8 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
||||||
// score
|
// score
|
||||||
if(m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard)
|
if(m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard)
|
||||||
{
|
{
|
||||||
int Time = pInfo->m_Score < 0 ? 0 : pInfo->m_Score;
|
int Time = pInfo->m_Score == -9999 ? 0 : abs(pInfo->m_Score);
|
||||||
dbg_msg("Time", "%s, %d, %d", m_pClient->m_aClients[pInfo->m_ClientID].m_aName, Time, pInfo->m_Score);
|
str_format(aBuf, sizeof(aBuf), "%02d:%02d", Time/60, Time%60);
|
||||||
str_format(aBuf, sizeof(aBuf), "%02d:%02d.%02d", Time/6000, Time/100-(Time/6000*60), Time % 100);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Score, -999, 999));
|
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Score, -999, 999));
|
||||||
|
|
|
@ -626,11 +626,11 @@ void CGameContext::ConSetEyeEmote(IConsole::IResult *pResult,
|
||||||
"You don't have any eye emotes, remember to bind some. (until you die)");
|
"You don't have any eye emotes, remember to bind some. (until you die)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "on"))
|
else if(str_comp_nocase(pResult->GetString(0), "on") == 0)
|
||||||
pPlayer->m_EyeEmote = true;
|
pPlayer->m_EyeEmote = true;
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "off"))
|
else if(str_comp_nocase(pResult->GetString(0), "off") == 0)
|
||||||
pPlayer->m_EyeEmote = false;
|
pPlayer->m_EyeEmote = false;
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
else if(str_comp_nocase(pResult->GetString(0), "toggle") == 0)
|
||||||
pPlayer->m_EyeEmote = !pPlayer->m_EyeEmote;
|
pPlayer->m_EyeEmote = !pPlayer->m_EyeEmote;
|
||||||
pSelf->Console()->Print(
|
pSelf->Console()->Print(
|
||||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||||
|
@ -831,11 +831,11 @@ void CGameContext::ConSetBroadcastTime(IConsole::IResult *pResult, void *pUserDa
|
||||||
"Time will not be displayed in broadcast now");
|
"Time will not be displayed in broadcast now");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "on"))
|
else if(str_comp_nocase(pResult->GetString(0), "on") == 0)
|
||||||
pPlayer->m_BroadcastTime = true;
|
pPlayer->m_BroadcastTime = true;
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "off"))
|
else if(str_comp_nocase(pResult->GetString(0), "off") == 0)
|
||||||
pPlayer->m_BroadcastTime = false;
|
pPlayer->m_BroadcastTime = false;
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
else if(str_comp_nocase(pResult->GetString(0), "toggle") == 0)
|
||||||
pPlayer->m_BroadcastTime = !pPlayer->m_BroadcastTime;
|
pPlayer->m_BroadcastTime = !pPlayer->m_BroadcastTime;
|
||||||
|
|
||||||
pSelf->Console()->Print(
|
pSelf->Console()->Print(
|
||||||
|
@ -864,9 +864,9 @@ void CGameContext::ConSetServerGameTime(IConsole::IResult *pResult, void *pUserD
|
||||||
"Time will not be displayed in broadcast now");
|
"Time will not be displayed in broadcast now");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "on"))
|
else if(str_comp_nocase(pResult->GetString(0), "on") == 0)
|
||||||
pPlayer->m_GameTimerTime = true;
|
pPlayer->m_GameTimerTime = true;
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "off"))
|
else if(str_comp_nocase(pResult->GetString(0), "off") == 0)
|
||||||
pPlayer->m_GameTimerTime = false;
|
pPlayer->m_GameTimerTime = false;
|
||||||
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
||||||
pPlayer->m_GameTimerTime = !pPlayer->m_GameTimerTime;
|
pPlayer->m_GameTimerTime = !pPlayer->m_GameTimerTime;
|
||||||
|
|
|
@ -23,7 +23,7 @@ CHAT_COMMAND("saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Priv
|
||||||
CHAT_COMMAND("saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race")
|
CHAT_COMMAND("saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race")
|
||||||
CHAT_COMMAND("time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message")
|
CHAT_COMMAND("time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message")
|
||||||
CHAT_COMMAND("broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status")
|
CHAT_COMMAND("broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status")
|
||||||
CHAT_COMMAND("servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status")
|
CHAT_COMMAND("gametimertime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status")
|
||||||
|
|
||||||
#if defined(CONF_SQL)
|
#if defined(CONF_SQL)
|
||||||
CHAT_COMMAND("times", "?s?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTimes, this, "/times ?s?i shows last 5 times of the server or of a player beginning with name s starting with time i (i = 1 by default)")
|
CHAT_COMMAND("times", "?s?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTimes, this, "/times ?s?i shows last 5 times of the server or of a player beginning with name s starting with time i (i = 1 by default)")
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ void CCharacter::HandleBroadcast()
|
||||||
GameServer()->SendBroadcast(aBroadcast, m_pPlayer->GetCID());
|
GameServer()->SendBroadcast(aBroadcast, m_pPlayer->GetCID());
|
||||||
m_LastBroadcast = Server()->Tick();
|
m_LastBroadcast = Server()->Tick();
|
||||||
}
|
}
|
||||||
else if (m_pPlayer->m_BroadcastTime && m_LastBroadcast + Server()->TickSpeed() * g_Config.m_SvTimeInBroadcastInterval <= Server()->Tick())
|
else if (m_pPlayer->m_BroadcastTime && m_DDRaceState == DDRACE_STARTED && m_LastBroadcast + Server()->TickSpeed() * g_Config.m_SvTimeInBroadcastInterval <= Server()->Tick())
|
||||||
{
|
{
|
||||||
char aBuftime[64];
|
char aBuftime[64];
|
||||||
int IntTime = (int)((float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed()));
|
int IntTime = (int)((float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed()));
|
||||||
|
|
|
@ -40,8 +40,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
|
||||||
m_PauseInfo.m_Respawn = false;
|
m_PauseInfo.m_Respawn = false;
|
||||||
m_EyeEmote = true;
|
m_EyeEmote = true;
|
||||||
m_BroadcastTime = g_Config.m_SvTimeInBroadcast;
|
m_BroadcastTime = g_Config.m_SvTimeInBroadcast;
|
||||||
m_BroadcastTime = g_Config.m_SvTimeInGameTimer;
|
m_GameTimerTime = g_Config.m_SvTimeInGameTimer;
|
||||||
m_GameTimerTime = true;
|
|
||||||
m_DefEmote = EMOTE_HAPPY;
|
m_DefEmote = EMOTE_HAPPY;
|
||||||
m_DefEmoteReset = -1;
|
m_DefEmoteReset = -1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue