From 4f19c982febe0af02697e672ef375f0eb8fdda85 Mon Sep 17 00:00:00 2001 From: AnotherCommander Date: Sat, 18 Jul 2020 13:49:20 +0200 Subject: [PATCH] Cloaked ships do mass lock the player now. --- src/Core/Entities/PlayerEntity.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 679d2269..1bcfcb74 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -3289,6 +3289,7 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market); - (BOOL) checkEntityForMassLock:(Entity *)ent withScanClass:(int)theirClass { BOOL massLocked = NO; + BOOL entIsCloakedShip = [ent isShip] && [(ShipEntity *)ent isCloaked]; if (EXPECT_NOT([ent isStellarObject])) { @@ -3308,8 +3309,7 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market); } else if (theirClass != CLASS_NO_DRAW) { - // cloaked ships do not mass lock! - if (EXPECT_NOT ([ent isShip] && [(ShipEntity *)ent isCloaked])) + if (EXPECT_NOT (entIsCloakedShip) { theirClass = CLASS_NO_DRAW; } @@ -3320,6 +3320,12 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market); switch (theirClass) { case CLASS_NO_DRAW: + // cloaked ships do mass lock! - Nikos 20200718 + if (entIsCloakedShip && ![ent isPlayer]) + { + massLocked = YES; + } + break; case CLASS_PLAYER: case CLASS_BUOY: case CLASS_ROCK: