Skip to content

Commit

Permalink
fix: don't show huge split time
Browse files Browse the repository at this point in the history
before
```
AngerySnek is now on Portal Carousel (5:34.283 -> 5:34.283)
Msushi is now on Portal Carousel (19883:16:56.000 -> 5:35.250)
Just Banana is now on Portal Carousel (0.133 -> 5:35.917)
```
after
```
AngerySnek is now on Portal Carousel (5:34.283)
Msushi is now on Portal Carousel (5:35.250)
Just Banana is now on Portal Carousel (0.133 -> 5:35.917)
```
banana's time is still hecked, dont know what happened there
  • Loading branch information
ThisAMJ committed Sep 7, 2024
1 parent c072a71 commit 6a32ad5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/cvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@
|sar_velocitygraph|0|Shows velocity graph.|
|sar_velocitygraph_background|0|Background of velocity graph.|
|sar_velocitygraph_font_index|21|Font index of velocity graph.|
|sar_velocitygraph_show_line|1|Shows line for velocity graph.|
|sar_velocitygraph_rainbow|0|Rainbow mode of velocity graph text.|
|sar_velocitygraph_show_line|1|Shows line for velocity graph.|
|sar_velocitygraph_show_speed_on_graph|1|Show speed between jumps.|
|sar_velocitygraph_x|-250|Velocity graph x axis offset.|
|sar_velocitygraph_y|-175|Velocity graph y axis offset.|
Expand Down
12 changes: 8 additions & 4 deletions src/Features/Demo/NetworkGhostPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,16 +529,20 @@ void NetworkManager::NotifyMapChange() {
sf::Packet packet;

if (ghost_show_advancement.GetInt() >= 3 && AcknowledgeGhost(nullptr)) {
std::string msg;
if (this->splitTicks != (sf::Uint32)-1) {
auto ipt = *engine->interval_per_tick;
std::string time = SpeedrunTimer::Format(this->splitTicks * ipt);
std::string totalTime = SpeedrunTimer::Format(this->splitTicksTotal * ipt);
std::string msg = Utils::ssprintf("%s is now on %s (%s -> %s)", this->name.c_str(), engine->GetCurrentMapTitle().c_str(), time.c_str(), totalTime.c_str());
toastHud.AddToast(GHOST_TOAST_TAG, msg);
if (this->splitTicks < this->splitTicksTotal) {
msg = Utils::ssprintf("%s is now on %s (%s -> %s)", this->name.c_str(), engine->GetCurrentMapTitle().c_str(), time.c_str(), totalTime.c_str());
} else {
msg = Utils::ssprintf("%s is now on %s (%s)", this->name.c_str(), engine->GetCurrentMapTitle().c_str(), totalTime.c_str());
}
} else {
std::string msg = Utils::ssprintf("%s is now on %s", this->name.c_str(), engine->GetCurrentMapTitle().c_str());
toastHud.AddToast(GHOST_TOAST_TAG, msg);
msg = Utils::ssprintf("%s is now on %s", this->name.c_str(), engine->GetCurrentMapTitle().c_str());
}
toastHud.AddToast(GHOST_TOAST_TAG, msg);
}

addToNetDump("send-map-change", engine->GetCurrentMapName().c_str());
Expand Down

0 comments on commit 6a32ad5

Please sign in to comment.