16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 17:29:18 +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
if (simulation::is_ready)
{
std::string PlayerVehicle = simulation::Train->name();
std::string PlayerVehicle;
if (simulation::Train != nullptr)
{
PlayerVehicle = simulation::Train->name();
// make to upper
for (auto &c : PlayerVehicle)
c = toupper(c);
@@ -241,6 +244,10 @@ void eu07_application::DiscordRPCService()
discord_rpc.smallImageKey = "halt";
discord_rpc.smallImageText = Translations.lookup_c("Stopped");
}
}
Discord_UpdatePresence(&discord_rpc);
}