fixed repair silos (for ground vehicles) with logic (#1031)

This commit is contained in:
Fate-JH 2023-02-18 08:58:06 -05:00 committed by GitHub
parent 09172edcd9
commit 3f07dbe8ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,10 +65,10 @@ object EffectTarget {
private def CommonRepairConditions(v: Vehicle): Boolean = { private def CommonRepairConditions(v: Vehicle): Boolean = {
v.Health > 0 && v.Health < v.MaxHealth && v.Health > 0 && v.Health < v.MaxHealth &&
v.History.findLast { entry => entry.isInstanceOf[DamagingActivity] }.exists { (v.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match {
case entry if System.currentTimeMillis() - entry.time < 5000L => true case Some(entry) if System.currentTimeMillis() - entry.time < 5000L => false
case _ => false case _ => true
} })
} }
def Player(target: PlanetSideGameObject): Boolean = def Player(target: PlanetSideGameObject): Boolean =
@ -140,7 +140,7 @@ object EffectTarget {
def AncientWeaponRecharge(target: PlanetSideGameObject): Boolean = { def AncientWeaponRecharge(target: PlanetSideGameObject): Boolean = {
target match { target match {
case p: Player => case p: Player =>
(p.Holsters().map { _.Equipment }.flatten.toIterable ++ p.Inventory.Items.map { _.obj }) (p.Holsters().flatMap { _.Equipment }.toIterable ++ p.Inventory.Items.map { _.obj })
.flatMap { .flatMap {
case weapon: Tool => weapon.AmmoSlots case weapon: Tool => weapon.AmmoSlots
case _ => Nil case _ => Nil