Skip to content

Commit

Permalink
prevent traders from keeping each other at cowering status (issue pio…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziusudra committed Aug 21, 2011
1 parent 3b007e4 commit a218c83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/modules/TradeShips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,10 @@ local onShipAlertChanged = function (ship, alert)
if trade_ships[ship.label] == nil then return end
print(ship.label..' alert changed to '..alert)
local trader = trade_ships[ship.label]
if trader.attacker == nil then return end

if alert == 'NONE' then
if alert == 'NONE' or not trader.attacker:exists() or
(alert == 'SHIP_NEARBY' and ship:DistanceTo(trader.attacker) > 100) then
if trader.status == 'fleeing' then
-- had not reached starport yet
trader['status'] = 'inbound'
Expand Down

0 comments on commit a218c83

Please sign in to comment.