mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Show error messages in console when add_demomarker
fails
When there are too many demo markers already or when the previous demo marker is too close.
This commit is contained in:
parent
349eb38ebf
commit
5d7f2c6e1b
|
@ -415,20 +415,34 @@ void CDemoRecorder::AddDemoMarker(int Tick)
|
||||||
{
|
{
|
||||||
dbg_assert(Tick >= 0, "invalid marker tick");
|
dbg_assert(Tick >= 0, "invalid marker tick");
|
||||||
if(m_NumTimelineMarkers >= MAX_TIMELINE_MARKERS)
|
if(m_NumTimelineMarkers >= MAX_TIMELINE_MARKERS)
|
||||||
|
{
|
||||||
|
if(m_pConsole)
|
||||||
|
{
|
||||||
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demo_recorder", "Too many timeline markers", gs_DemoPrintColor);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// not more than 1 marker in a second
|
// not more than 1 marker in a second
|
||||||
if(m_NumTimelineMarkers > 0)
|
if(m_NumTimelineMarkers > 0)
|
||||||
{
|
{
|
||||||
int Diff = Tick - m_aTimelineMarkers[m_NumTimelineMarkers - 1];
|
const int Diff = Tick - m_aTimelineMarkers[m_NumTimelineMarkers - 1];
|
||||||
if(Diff < (float)SERVER_TICK_SPEED)
|
if(Diff < (float)SERVER_TICK_SPEED)
|
||||||
|
{
|
||||||
|
if(m_pConsole)
|
||||||
|
{
|
||||||
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demo_recorder", "Previous timeline marker too close", gs_DemoPrintColor);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_aTimelineMarkers[m_NumTimelineMarkers++] = Tick;
|
m_aTimelineMarkers[m_NumTimelineMarkers++] = Tick;
|
||||||
|
|
||||||
if(m_pConsole)
|
if(m_pConsole)
|
||||||
|
{
|
||||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demo_recorder", "Added timeline marker", gs_DemoPrintColor);
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demo_recorder", "Added timeline marker", gs_DemoPrintColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CDemoPlayer::CDemoPlayer(class CSnapshotDelta *pSnapshotDelta, bool UseVideo, TUpdateIntraTimesFunc &&UpdateIntraTimesFunc)
|
CDemoPlayer::CDemoPlayer(class CSnapshotDelta *pSnapshotDelta, bool UseVideo, TUpdateIntraTimesFunc &&UpdateIntraTimesFunc)
|
||||||
|
|
Loading…
Reference in a new issue