Skip to content

Commit

Permalink
Change logic of SetStartTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Oct 12, 2023
1 parent c72f014 commit 3317800
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaDiscordDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,13 @@ bool CLuaDiscordDefs::SetDetails(std::string strDetails)
return true;
}

bool CLuaDiscordDefs::SetStartTime(unsigned long iSecondsSinceEpoch)
bool CLuaDiscordDefs::SetStartTime(unsigned long ulTime)
{
unsigned long iSecondsSinceEpoch = time(nullptr) + ulTime;

if (ulTime == 0)
iSecondsSinceEpoch = 0;

auto discord = g_pCore->GetDiscord();

if (!discord || !discord->IsDiscordRPCEnabled())
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaDiscordDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CLuaDiscordDefs : public CLuaDefs
static bool SetButtons(unsigned short int iIndex, std::string szName, std::string szUrl);
static bool SetLargeAsset(std::string szAsset, std::string szAssetText);
static bool SetSmallAsset(std::string szAsset, std::string szAssetText);
static bool SetStartTime(unsigned long iSecondsSinceEpoch);
static bool SetStartTime(unsigned long ulTime);
static bool SetPartySize(int iMin, int iMax);
static bool IsDiscordRPCConnected();

Expand Down

0 comments on commit 3317800

Please sign in to comment.