fix(PlayerInfo): Prevent a crash when a player DC's

This commit is contained in:
Yimura 2021-10-15 11:28:13 +02:00
parent 205a58716e
commit 853d33a534

View File

@ -12,10 +12,10 @@ namespace big
ImGui::Text("Player ID: %d", g.selected_player.id);
if (g.selected_player.net_player != nullptr)
CPlayerInfo* player_info = g.selected_player.net_player->player_info;
if (g.selected_player.net_player != nullptr && player_info != nullptr)
{
ImGui::Text("Session Host: %s", g.selected_player.net_player->is_host() ? "Yes" : "No");
CPlayerInfo* player_info = g.selected_player.net_player->player_info;
ImGui::Text("Rockstar ID: %d", player_info->m_rockstar_id);
ImGui::Text("IP Address: %d.%d.%d.%d:%d", player_info->m_external_ip.m_field1, player_info->m_external_ip.m_field2, player_info->m_external_ip.m_field3, player_info->m_external_ip.m_field4, player_info->m_external_port);