Small Fix

This commit is contained in:
TheBrokenRail 2024-11-21 17:41:24 -05:00
parent 900169a728
commit 7f9d1d843e

View File

@ -47,9 +47,9 @@ static std::string base64_encode(const std::string &data) {
} }
// Change Texture For Player Entities // Change Texture For Player Entities
static void Player_username_assign_injection(std::string *target, std::string *username) { static void Player_username_assign_injection(std::string *target, const std::string &username) {
// Call Original Method // Call Original Method
*target = *username; *target = username;
// Get Player // Get Player
Player *player = (Player *) (((unsigned char *) target) - offsetof(Player, username)); Player *player = (Player *) (((unsigned char *) target) - offsetof(Player, username));
@ -57,11 +57,11 @@ static void Player_username_assign_injection(std::string *target, std::string *u
std::string *texture = &player->texture; std::string *texture = &player->texture;
// Set Texture // Set Texture
*texture = '$' + base64_encode(*username); *texture = '$' + base64_encode(username);
} }
static void Player_username_assign_injection_2(std::string *target, const char *username) { static void Player_username_assign_injection_2(std::string *target, const char *username) {
std::string username_str = username; const std::string username_str = username;
Player_username_assign_injection(target, &username_str); Player_username_assign_injection(target, username_str);
} }
// Change Texture For HUD // Change Texture For HUD