mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
commit
efe7e09514
|
|
@ -5,6 +5,7 @@ import net.psforever.objects.serverobject.PlanetSideServerObject
|
||||||
import net.psforever.objects.serverobject.environment.{EnvironmentTrait, PieceOfEnvironment}
|
import net.psforever.objects.serverobject.environment.{EnvironmentTrait, PieceOfEnvironment}
|
||||||
import net.psforever.objects.zones._
|
import net.psforever.objects.zones._
|
||||||
import net.psforever.objects.zones.blockmap.{BlockMapEntity, SectorGroup, SectorPopulation}
|
import net.psforever.objects.zones.blockmap.{BlockMapEntity, SectorGroup, SectorPopulation}
|
||||||
|
import net.psforever.types.Vector3
|
||||||
|
|
||||||
import scala.collection.mutable
|
import scala.collection.mutable
|
||||||
|
|
||||||
|
|
@ -183,7 +184,7 @@ case class OnStableEnvironment() extends InteractionBehavior {
|
||||||
existing: Set[PieceOfEnvironment],
|
existing: Set[PieceOfEnvironment],
|
||||||
allow: Boolean
|
allow: Boolean
|
||||||
): Set[PieceOfEnvironment] = {
|
): Set[PieceOfEnvironment] = {
|
||||||
if (allow) {
|
if (obj.Position != Vector3.Zero && allow) {
|
||||||
val interactions = obj.interaction().collectFirst { case inter: InteractWithEnvironment => inter.Interactions }
|
val interactions = obj.interaction().collectFirst { case inter: InteractWithEnvironment => inter.Interactions }
|
||||||
val bodies = InteractWithEnvironment.checkAllEnvironmentInteractions(obj, sector)
|
val bodies = InteractWithEnvironment.checkAllEnvironmentInteractions(obj, sector)
|
||||||
bodies.foreach(body => interactions.flatMap(_.get(body.attribute)).foreach(_.doInteractingWith(obj, body, None)))
|
bodies.foreach(body => interactions.flatMap(_.get(body.attribute)).foreach(_.doInteractingWith(obj, body, None)))
|
||||||
|
|
@ -224,7 +225,7 @@ final case class AwaitOngoingInteraction(zone: Zone) extends InteractionBehavior
|
||||||
allow: Boolean
|
allow: Boolean
|
||||||
): Set[PieceOfEnvironment] = {
|
): Set[PieceOfEnvironment] = {
|
||||||
val interactions = obj.interaction().collectFirst { case inter: InteractWithEnvironment => inter.Interactions }
|
val interactions = obj.interaction().collectFirst { case inter: InteractWithEnvironment => inter.Interactions }
|
||||||
if (allow) {
|
if (obj.Position != Vector3.Zero && allow) {
|
||||||
val bodies = InteractWithEnvironment.checkAllEnvironmentInteractions(obj, sector)
|
val bodies = InteractWithEnvironment.checkAllEnvironmentInteractions(obj, sector)
|
||||||
val (in, out) = existing.partition(body => InteractWithEnvironment.checkSpecificEnvironmentInteraction(zone, body, obj).nonEmpty)
|
val (in, out) = existing.partition(body => InteractWithEnvironment.checkSpecificEnvironmentInteraction(zone, body, obj).nonEmpty)
|
||||||
val inAttrs = bodies.map(_.attribute)
|
val inAttrs = bodies.map(_.attribute)
|
||||||
|
|
@ -268,7 +269,7 @@ case class BlockedFromInteracting() extends InteractionBehavior {
|
||||||
existing: Set[PieceOfEnvironment],
|
existing: Set[PieceOfEnvironment],
|
||||||
allow: Boolean
|
allow: Boolean
|
||||||
): Set[PieceOfEnvironment] = {
|
): Set[PieceOfEnvironment] = {
|
||||||
if (allow) {
|
if (obj.Position != Vector3.Zero && allow) {
|
||||||
nextstep = OnStableEnvironment()
|
nextstep = OnStableEnvironment()
|
||||||
}
|
}
|
||||||
Set()
|
Set()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue