Skip to content

Commit

Permalink
RPC: Always convert current map name to lowercase for thumbnails (#164)
Browse files Browse the repository at this point in the history
* RPC: Always convert current map name to lowercase for thumbnails

* RPC: Replaced bhop_MoLwiz with bhop_molwiz

That was a single map from list with uppercase name before lmao

* RPC: Change directly map_name to lowercase instead of copying to temp
  • Loading branch information
SmileyAG authored Apr 14, 2022
1 parent e560896 commit 679f146
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cl_dll/discord_integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ namespace discord_integration
"bh_axn_tunnel"s,
"bhm_assault"s,
"bhm_ramp"s,
"bhop_MoLwiz"s,
"bhop_aeonflux"s,
"bhop_avantura"s,
"bhop_axn_project64"s,
Expand All @@ -58,6 +57,7 @@ namespace discord_integration
"bhop_maratona"s,
"bhop_medieval"s,
"bhop_minecraft_v1"s,
"bhop_molwiz"s,
"bhop_platinum"s,
"bhop_pool_day"s,
"bhop_river_wb"s,
Expand Down Expand Up @@ -343,6 +343,13 @@ namespace discord_integration
get_map_name(map_name, ARRAYSIZE(map_name));
if (map_name[0])
{
// adjust to lowercase
unsigned char *tptr = (unsigned char *)map_name;
while (*tptr) {
*tptr = tolower(*tptr);
tptr++;
}

if (maps_with_thumbnails.find(map_name) != maps_with_thumbnails.cend())
presence.largeImageKey = map_name;

Expand Down

0 comments on commit 679f146

Please sign in to comment.