mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-28 23:35:23 +00:00
Fix capturing neutral LLU bases with no friendly neighbours as a timed hack
This commit is contained in:
parent
920d71c2f3
commit
0d046dedeb
1 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue