diff --git a/include/mediaplayer/mc/level.h b/include/mediaplayer/mc/level.h index 1caec50..bedad59 100644 --- a/include/mediaplayer/mc/level.h +++ b/include/mediaplayer/mc/level.h @@ -5,6 +5,6 @@ struct level; -struct player *get_player_by_xuid(struct level *level, const char *xuid); +struct player *get_player_by_xuid(const char *xuid); extern struct level *g_level; diff --git a/src/mc/level.c b/src/mc/level.c index 6a74cc8..9f0e01b 100644 --- a/src/mc/level.c +++ b/src/mc/level.c @@ -3,14 +3,14 @@ struct level *g_level = NULL; -struct player *get_player_by_xuid(struct level *level, const char *xuid) +struct player *get_player_by_xuid(const char *xuid) { struct string *xuid_cpp_str = std_string_string(xuid); struct player *player = TLCALL("?getPlayerByXuid@Level@@UEBAPEAVPlayer@@AEBV?$basic_string@" "DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z", struct player *(*)(struct level *level, struct string *xuid), - level, xuid_cpp_str); + g_level, xuid_cpp_str); free(xuid_cpp_str); return player; } diff --git a/src/music_player.c b/src/music_player.c index 918bcc2..57115cc 100644 --- a/src/music_player.c +++ b/src/music_player.c @@ -127,7 +127,7 @@ void music_queue_delete_player(long long xuid) free(curr_node); char player_xuid[PLAYER_XUID_STR_LEN]; _i64toa(xuid, player_xuid, 10); - struct player *player = get_player_by_xuid(g_level, player_xuid); + struct player *player = get_player_by_xuid(player_xuid); if (is_player(player)) send_boss_event_packet(player, "", 0, BOSS_BAR_HIDE); video_queue_delete_player(xuid); @@ -151,7 +151,7 @@ void send_music_sound_packet(void) struct music_queue_node *music_queue_node_curr = music_queue_head; while (music_queue_node_curr != NULL) { sprintf_s(player_xuid, PLAYER_XUID_STR_LEN, "%lld", music_queue_node_curr->xuid); - player = get_player_by_xuid(g_level, player_xuid); + player = get_player_by_xuid(player_xuid); if (!player) { struct music_queue_node *to_delete = music_queue_node_curr; music_queue_node_curr = music_queue_node_curr->next; diff --git a/src/video_player.c b/src/video_player.c index bc9438f..437b5e9 100644 --- a/src/video_player.c +++ b/src/video_player.c @@ -54,7 +54,7 @@ void play_video(struct video_queue *video_queue_node, struct map_item_saved_data return; char player_xuid[PLAYER_XUID_STR_LEN]; sprintf_s(player_xuid, PLAYER_XUID_STR_LEN, "%lld", video_queue_node->xuid); - struct player *player = get_player_by_xuid(g_level, player_xuid); + struct player *player = get_player_by_xuid(player_xuid); char filepath[260]; if (((time_t)clock() - video_queue_node->start_time) <= 0)