Skip to content

Commit

Permalink
chore(map): exclude jita from jump targets
Browse files Browse the repository at this point in the history
  • Loading branch information
updraft0 committed Sep 24, 2024
1 parent cfdd34f commit 53fd768
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.updraft0.controltower.constant

/** Magic constants (that are hard to put anywhere else)
/** Magic constants live here instead of being sprinkled around the codebase. Might as well keep them in one place.
*/
object MagicConstant:
// The grid snapping of a system map
Expand All @@ -14,7 +14,6 @@ object MagicConstant:
val CharacterImageSize: Int = 32

// Systems
// TODO use
val Jita: SystemId = SystemId(30000142)

// UI elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,9 @@ object MapEntity extends ReactiveEntity[MapEnv, MapId, MapState, Identified[MapR
private def isPotentialWormholeJump(state: MapState, fromSystemId: SystemId, toSystemId: SystemId) =
val differentSystem = fromSystemId != toSystemId
val noGate = !state.hasGateBetween(fromSystemId, toSystemId)
val notJita = fromSystemId != MagicConstant.Jita && toSystemId != MagicConstant.Jita
val isTarget = state.refSystem(fromSystemId).zip(state.refSystem(toSystemId)).exists(isTargetForJumps)
differentSystem && noGate && isTarget
differentSystem && noGate && notJita && isTarget

private def isKnownSpace(state: MapState, systemId: SystemId) =
state.refSystem(systemId).exists(_.whClass.spaceType == SpaceType.Known)
Expand Down

0 comments on commit 53fd768

Please sign in to comment.