Skip to content

Commit

Permalink
fixed crash when trying to sell to base medicines with full ship carg…
Browse files Browse the repository at this point in the history
…o (issue #49)
  • Loading branch information
thindil committed Nov 6, 2019
1 parent c9ac30f commit 77c4499
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/ui/maps-ui-handlers.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1365,11 +1365,17 @@ package body Maps.UI.Handlers is
(PlayerShip, PlayerShip.Cargo.Element(ItemIndex).ProtoIndex,
(0 - PlayerShip.Cargo.Element(ItemIndex).Amount));
else
GainRep
(BaseIndex, ((PlayerShip.Cargo(ItemIndex).Amount / 20) * (-1)));
SellItems
(ItemIndex,
Integer'Image(PlayerShip.Cargo.Element(ItemIndex).Amount));
begin
SellItems
(ItemIndex,
Integer'Image(PlayerShip.Cargo.Element(ItemIndex).Amount));
GainRep
(BaseIndex, ((PlayerShip.Cargo(ItemIndex).Amount / 20) * (-1)));
exception
when Trade_No_Free_Cargo =>
ShowDialog
("You can't sell medicines to the base because you don't have enough free cargo space for money.");
end;
end if;
UpdateHeader;
UpdateMessages;
Expand Down

0 comments on commit 77c4499

Please sign in to comment.