Skip to content

Commit

Permalink
fix: crash on trying sort of shipyard modules
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 9eb9b384ae4af8537d466b9f61038524cb369318e95a685e305ea5bc865ac2e2
  • Loading branch information
thindil committed Jul 20, 2024
1 parent ee1a3d4 commit ff007bf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ui/bases-shipyardui.adb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ package body Bases.ShipyardUI is
Command => "SortShipyardModules remove 0 {}",
Tooltip_Text => "Press mouse button to sort the modules.");
end if;
if Install_Indexes.Length = 0 then
Fill_Install_Indexes_Loop :
for I in 1 .. Get_Modules_Amount loop
Install_Indexes.Append(New_Item => I);
end loop Fill_Install_Indexes_Loop;
end if;
if Remove_Indexes.Length /= Player_Ship.Modules.Length then
Remove_Indexes.Clear;
Fill_Remove_Indexes_Loop :
for I in Player_Ship.Modules.Iterate loop
Remove_Indexes.Append
(New_Item => Modules_Container.To_Index(Position => I));
end loop Fill_Remove_Indexes_Loop;
end if;
return TCL_OK;
end Show_Shipyard_Command;

Expand Down

0 comments on commit ff007bf

Please sign in to comment.