16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 22:09:19 +02:00

DiscordRPC fix when driving ghostview

This commit is contained in:
2025-02-28 12:15:46 +01:00
parent a88465357e
commit 663336b86e

View File

@@ -219,7 +219,10 @@ void eu07_application::DiscordRPCService()
// Discord RPC updater // Discord RPC updater
if (simulation::is_ready) if (simulation::is_ready)
{ {
std::string PlayerVehicle = simulation::Train->name(); std::string PlayerVehicle;
if (simulation::Train != nullptr)
{
PlayerVehicle = simulation::Train->name();
// make to upper // make to upper
for (auto &c : PlayerVehicle) for (auto &c : PlayerVehicle)
c = toupper(c); c = toupper(c);
@@ -241,6 +244,10 @@ void eu07_application::DiscordRPCService()
discord_rpc.smallImageKey = "halt"; discord_rpc.smallImageKey = "halt";
discord_rpc.smallImageText = Translations.lookup_c("Stopped"); discord_rpc.smallImageText = Translations.lookup_c("Stopped");
} }
}
Discord_UpdatePresence(&discord_rpc); Discord_UpdatePresence(&discord_rpc);
} }