diff --git a/src/C4Console.cpp b/src/C4Console.cpp index a3a44b3a4..808eb1486 100644 --- a/src/C4Console.cpp +++ b/src/C4Console.cpp @@ -1799,7 +1799,10 @@ void C4Console::OnPlrJoin(GtkWidget *item, gpointer data) void C4Console::OnPlrQuit(GtkWidget *item, gpointer data) { - Game.Control.Input.Add(CID_EliminatePlayer, new C4ControlEliminatePlayer(GPOINTER_TO_INT(data))); + const std::int32_t playerNumber{GPOINTER_TO_INT(data)}; + C4Player *const player{Game.Players.Get(playerNumber)}; + + Game.Control.Input.Add(CID_EliminatePlayer, new C4ControlEliminatePlayer(Game.GetSectionIndex(**player->ViewSection), GPOINTER_TO_INT(data))); } void C4Console::OnViewNew(GtkWidget *item, gpointer data) diff --git a/src/C4ObjectListDlg.cpp b/src/C4ObjectListDlg.cpp index a4e485037..ae19eca75 100644 --- a/src/C4ObjectListDlg.cpp +++ b/src/C4ObjectListDlg.cpp @@ -61,7 +61,7 @@ GType c4_list_get_type(void); static void c4_list_init(C4List *c4_list) { - c4_list->data = &Game.Objects; + c4_list->data = &Game.Sections.front()->Objects; // FIXME c4_list->stamp = g_random_int(); /* Random int to check whether iters belong to this model */ } diff --git a/src/C4Viewport.cpp b/src/C4Viewport.cpp index cb8851993..840d7fd8f 100644 --- a/src/C4Viewport.cpp +++ b/src/C4Viewport.cpp @@ -318,9 +318,11 @@ GtkWidget *C4ViewportWindow::InitGUI() v_scrollbar = gtk_vscrollbar_new(nullptr); table = gtk_table_new(2, 2, FALSE); + C4Section §ion{cvp->GetViewSection()}; + GtkAdjustment *adjustment = gtk_range_get_adjustment(GTK_RANGE(h_scrollbar)); adjustment->lower = 0; - adjustment->upper = ViewSection->Landscape.Width; + adjustment->upper = section.Landscape.Width; adjustment->step_increment = ViewportScrollSpeed; g_signal_connect( @@ -332,7 +334,7 @@ GtkWidget *C4ViewportWindow::InitGUI() adjustment = gtk_range_get_adjustment(GTK_RANGE(v_scrollbar)); adjustment->lower = 0; - adjustment->upper = ViewSection->Landscape.Height; + adjustment->upper = section.Landscape.Height; adjustment->step_increment = ViewportScrollSpeed; g_signal_connect( @@ -436,7 +438,7 @@ void C4ViewportWindow::OnDragDataReceivedStatic(GtkWidget *widget, GdkDragContex gchar *file = g_filename_from_uri(*uri, nullptr, nullptr); if (!file) continue; - Game.DropFile(file, window->cvp->ViewX + static_cast(x / scale), window->cvp->ViewY + static_cast(y / scale)); + Game.DropFile(window->cvp->GetViewSection(), file, window->cvp->ViewX + static_cast(x / scale), window->cvp->ViewY + static_cast(y / scale)); g_free(file); }