Browse Source

Fix trader command always opening trader on select

feature_improvement
Anton Tarasenko 2 years ago
parent
commit
dd464554b7
  1. 5
      sources/Commands/ACommandTrader.uc

5
sources/Commands/ACommandTrader.uc

@ -313,11 +313,12 @@ protected function HandleTraderSwap(
ETrader oldTrader, ETrader oldTrader,
ETrader newTrader) ETrader newTrader)
{ {
local bool closeOldTrader; local bool closeOldTrader, openNewTrader;
if (oldTrader == none) return; if (oldTrader == none) return;
if (oldTrader.SameAs(newTrader)) return; if (oldTrader.SameAs(newTrader)) return;
closeOldTrader = newTrader == none || !newTrader.IsOpen(); closeOldTrader = newTrader == none || !newTrader.IsOpen();
openNewTrader = oldTrader.IsOpen();
if (closeOldTrader) if (closeOldTrader)
{ {
if (!result.options.HasKey(T(TIGNORE_DOORS))) { if (!result.options.HasKey(T(TIGNORE_DOORS))) {
@ -327,7 +328,7 @@ protected function HandleTraderSwap(
oldTrader.BootPlayers(); oldTrader.BootPlayers();
} }
} }
if (newTrader != none) { if (openNewTrader && newTrader != none) {
newTrader.Open(); newTrader.Open();
} }
} }

Loading…
Cancel
Save