mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-13 15:34:42 +00:00
Merge pull request #418 from Mazo/tower-painbox-fix
Ensure tower pain fields start up correctly
This commit is contained in:
commit
42a2512aa0
1 changed files with 9 additions and 5 deletions
|
|
@ -18,6 +18,8 @@ class PainboxControl(painbox: Painbox) extends Actor {
|
||||||
var bBoxMaxCorner = Vector3.Zero
|
var bBoxMaxCorner = Vector3.Zero
|
||||||
var bBoxMidPoint = Vector3.Zero
|
var bBoxMidPoint = Vector3.Zero
|
||||||
|
|
||||||
|
var disabled = false // Temporary to disable cavern non-radius fields
|
||||||
|
|
||||||
def receive: Receive = {
|
def receive: Receive = {
|
||||||
case "startup" =>
|
case "startup" =>
|
||||||
if (painbox.Definition.HasNearestDoorDependency) {
|
if (painbox.Definition.HasNearestDoorDependency) {
|
||||||
|
|
@ -35,14 +37,12 @@ class PainboxControl(painbox: Painbox) extends Actor {
|
||||||
case _ =>
|
case _ =>
|
||||||
log.error(s"Painbox ${painbox.GUID} on ${painbox.Owner.Continent} - ${painbox.Position} can not find a door that it is dependent on")
|
log.error(s"Painbox ${painbox.GUID} on ${painbox.Owner.Continent} - ${painbox.Position} can not find a door that it is dependent on")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
context.become(Stopped)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (painbox.Definition.Radius == 0f) {
|
if (painbox.Definition.Radius == 0f) {
|
||||||
if (painbox.Owner.Continent.matches("c[0-9]")) {
|
if (painbox.Owner.Continent.matches("c[0-9]")) {
|
||||||
// todo: handle non-radius painboxes in caverns properly
|
// todo: handle non-radius painboxes in caverns properly
|
||||||
log.warn(s"Skipping initialization of ${painbox.GUID} on ${painbox.Owner.Continent} - ${painbox.Position}")
|
log.warn(s"Skipping initialization of ${painbox.GUID} on ${painbox.Owner.Continent} - ${painbox.Position}")
|
||||||
|
disabled = true
|
||||||
} else {
|
} else {
|
||||||
painbox.Owner match {
|
painbox.Owner match {
|
||||||
case obj: Building =>
|
case obj: Building =>
|
||||||
|
|
@ -83,9 +83,13 @@ class PainboxControl(painbox: Painbox) extends Actor {
|
||||||
case _ => None
|
case _ => None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.become(Stopped)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!disabled) {
|
||||||
|
context.become(Stopped)
|
||||||
|
}
|
||||||
|
|
||||||
case _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue