Fix capturing neutral LLU bases with no friendly neighbours as a timed hack

This commit is contained in:
Mazo 2021-04-03 20:05:03 +01:00
parent 920d71c2f3
commit 0d046dedeb

View file

@ -81,8 +81,9 @@ class HackCaptureActor(val taskResolver: ActorRef) extends Actor {
val hackedByFaction = entry.target.HackedBy.get.hackerFaction val hackedByFaction = entry.target.HackedBy.get.hackerFaction
entry.target.Actor ! CommonMessages.ClearHack() entry.target.Actor ! CommonMessages.ClearHack()
entry.target.Owner.asInstanceOf[Building].GetFlagSocket match { // If the base has a socket, but no flag spawned it means the hacked base is neutral with no friendly neighbouring bases to deliver to, making it a timed hack.
case Some(socket) => (entry.target.Owner.asInstanceOf[Building].GetFlagSocket, entry.target.Owner.asInstanceOf[Building].GetFlag) match {
case (Some(socket), Some(_)) =>
// LLU was not delivered in time. Send resecured notifications // LLU was not delivered in time. Send resecured notifications
entry.target.Owner.asInstanceOf[Building].GetFlag match { entry.target.Owner.asInstanceOf[Building].GetFlag match {
case Some(flag: CaptureFlag) => entry.target.Zone.LocalEvents ! CaptureFlagManager.Lost(flag, CaptureFlagLostReasonEnum.TimedOut) case Some(flag: CaptureFlag) => entry.target.Zone.LocalEvents ! CaptureFlagManager.Lost(flag, CaptureFlagLostReasonEnum.TimedOut)
@ -90,8 +91,8 @@ class HackCaptureActor(val taskResolver: ActorRef) extends Actor {
} }
NotifyHackStateChange(entry.target, isResecured = true) NotifyHackStateChange(entry.target, isResecured = true)
case None => case _ =>
// Timed hack finished, capture the base // Timed hack finished (or neutral LLU base with no neighbour as timed hack), capture the base
HackCompleted(entry.target, hackedByFaction) HackCompleted(entry.target, hackedByFaction)
} }
}) })