mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-06 05:50:23 +00:00
Disable airpad / ground silo repairing functionality on vehicles that have been damaged within the last 5 seconds
This commit is contained in:
parent
449c727be7
commit
eabf1beb02
1 changed files with 3 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ package net.psforever.objects.equipment
|
|||
import net.psforever.objects._
|
||||
import net.psforever.objects.ce.DeployableCategory
|
||||
import net.psforever.objects.serverobject.turret.FacilityTurret
|
||||
import net.psforever.objects.vital.DamagingActivity
|
||||
|
||||
final case class TargetValidation(category: EffectTarget.Category.Value, test: EffectTarget.Validation.Value)
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ object EffectTarget {
|
|||
def RepairSilo(target: PlanetSideGameObject): Boolean =
|
||||
target match {
|
||||
case v: Vehicle =>
|
||||
!GlobalDefinitions.isFlightVehicle(v.Definition) && v.Health > 0 && v.Health < v.MaxHealth
|
||||
!GlobalDefinitions.isFlightVehicle(v.Definition) && v.Health > 0 && v.Health < v.MaxHealth && v.History.find(x => x.isInstanceOf[DamagingActivity] && x.t >= (System.nanoTime - 5000000000L)).isEmpty
|
||||
case _ =>
|
||||
false
|
||||
}
|
||||
|
|
@ -49,7 +50,7 @@ object EffectTarget {
|
|||
def PadLanding(target: PlanetSideGameObject): Boolean =
|
||||
target match {
|
||||
case v: Vehicle =>
|
||||
GlobalDefinitions.isFlightVehicle(v.Definition) && v.Health > 0 && v.Health < v.MaxHealth
|
||||
GlobalDefinitions.isFlightVehicle(v.Definition) && v.Health > 0 && v.Health < v.MaxHealth && v.History.find(x => x.isInstanceOf[DamagingActivity] && x.t >= (System.nanoTime - 5000000000L)).isEmpty
|
||||
case _ =>
|
||||
false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue