Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safely Tucked Away #1238

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import net.psforever.objects.serverobject.PlanetSideServerObject
import net.psforever.objects.serverobject.environment.{EnvironmentTrait, PieceOfEnvironment}
import net.psforever.objects.zones._
import net.psforever.objects.zones.blockmap.{BlockMapEntity, SectorGroup, SectorPopulation}
import net.psforever.types.Vector3

import scala.collection.mutable

Expand Down Expand Up @@ -183,7 +184,7 @@ case class OnStableEnvironment() extends InteractionBehavior {
existing: Set[PieceOfEnvironment],
allow: Boolean
): Set[PieceOfEnvironment] = {
if (allow) {
if (obj.Position != Vector3.Zero && allow) {
val interactions = obj.interaction().collectFirst { case inter: InteractWithEnvironment => inter.Interactions }
val bodies = InteractWithEnvironment.checkAllEnvironmentInteractions(obj, sector)
bodies.foreach(body => interactions.flatMap(_.get(body.attribute)).foreach(_.doInteractingWith(obj, body, None)))
Expand Down Expand Up @@ -224,7 +225,7 @@ final case class AwaitOngoingInteraction(zone: Zone) extends InteractionBehavior
allow: Boolean
): Set[PieceOfEnvironment] = {
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 (in, out) = existing.partition(body => InteractWithEnvironment.checkSpecificEnvironmentInteraction(zone, body, obj).nonEmpty)
val inAttrs = bodies.map(_.attribute)
Expand Down Expand Up @@ -268,7 +269,7 @@ case class BlockedFromInteracting() extends InteractionBehavior {
existing: Set[PieceOfEnvironment],
allow: Boolean
): Set[PieceOfEnvironment] = {
if (allow) {
if (obj.Position != Vector3.Zero && allow) {
nextstep = OnStableEnvironment()
}
Set()
Expand Down
Loading