fix(RID join): crash on join #3474 (#3511)

This commit is contained in:
Quentin 2024-08-03 18:14:42 +02:00 committed by GitHub
parent b92a41bd84
commit 09a60a98b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,19 +19,23 @@ namespace big
const char* name; const char* name;
}; };
static uint64_t rid = 0;
void render_join_game() void render_join_game()
{ {
ImGui::SeparatorText("JOIN_GAME"_T.data()); ImGui::SeparatorText("JOIN_GAME"_T.data());
ImGui::BeginGroup(); ImGui::BeginGroup();
static uint64_t rid = 0;
ImGui::SetNextItemWidth(200); ImGui::SetNextItemWidth(200);
bool rid_submitted = ImGui::InputScalar("##inputrid", ImGuiDataType_U64, &rid, nullptr, nullptr, nullptr, ImGuiInputTextFlags_EnterReturnsTrue); bool rid_submitted = ImGui::InputScalar("##inputrid", ImGuiDataType_U64, &rid, nullptr, nullptr, nullptr, ImGuiInputTextFlags_EnterReturnsTrue);
ImGui::SameLine(); ImGui::SameLine();
if (components::button("JOIN_BY_RID"_T) || rid_submitted) if (components::button("JOIN_BY_RID"_T) || rid_submitted)
{ {
session::join_by_rockstar_id(rid); const auto rid_lambda = rid;
g_fiber_pool->queue_job([rid_lambda]() {
session::join_by_rockstar_id(rid_lambda);
});
} }
ImGui::SetNextItemWidth(200); ImGui::SetNextItemWidth(200);