From 46b446048d2e9db618eded880a5726231d3d8e0f Mon Sep 17 00:00:00 2001 From: ScrawnyRonnie Date: Sun, 10 Dec 2023 18:55:18 -0500 Subject: [PATCH] don't need vals --- .../serverobject/damage/DamageableMountable.scala | 5 +---- .../services/account/AccountPersistenceService.scala | 10 ++-------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/scala/net/psforever/objects/serverobject/damage/DamageableMountable.scala b/src/main/scala/net/psforever/objects/serverobject/damage/DamageableMountable.scala index 009aedcf1..06403f5f1 100644 --- a/src/main/scala/net/psforever/objects/serverobject/damage/DamageableMountable.scala +++ b/src/main/scala/net/psforever/objects/serverobject/damage/DamageableMountable.scala @@ -80,10 +80,7 @@ object DamageableMountable { .flatMap { _.occupant } .collect { case player if player.isAlive => //make llu visible to others in zone if passenger is carrying one - val zone = player.Zone - val events = zone.AvatarEvents - val nameChannel = player.Name - events ! AvatarServiceMessage(nameChannel, AvatarAction.DropSpecialItem()) + player.Zone.AvatarEvents ! AvatarServiceMessage(player.Name, AvatarAction.DropSpecialItem()) //player.LogActivity(cause) player.Actor ! Player.Die( DamageInteraction(interaction.resolution, SourceEntry(player), interaction.cause, interaction.hitPos) diff --git a/src/main/scala/net/psforever/services/account/AccountPersistenceService.scala b/src/main/scala/net/psforever/services/account/AccountPersistenceService.scala index 4bbcaeed0..2576bfedf 100644 --- a/src/main/scala/net/psforever/services/account/AccountPersistenceService.scala +++ b/src/main/scala/net/psforever/services/account/AccountPersistenceService.scala @@ -366,10 +366,7 @@ class PersistenceMonitor( (inZone.Players.find(p => p.name == name), inZone.LivePlayers.find(p => p.Name == name)) match { case (Some(avatar), Some(player)) if player.VehicleSeated.nonEmpty => //in case the player is holding the llu and disconnects - val zone = player.Zone - val events = zone.AvatarEvents - val nameChannel = player.Name - events ! AvatarServiceMessage(nameChannel, AvatarAction.DropSpecialItem()) + player.Zone.AvatarEvents ! AvatarServiceMessage(player.Name, AvatarAction.DropSpecialItem()) //alive or dead in a vehicle //if the avatar is dead while in a vehicle, they haven't released yet AvatarActor.saveAvatarData(avatar) @@ -387,10 +384,7 @@ class PersistenceMonitor( case (Some(avatar), Some(player)) => //in case the player is holding the llu and disconnects - val zone = player.Zone - val events = zone.AvatarEvents - val nameChannel = player.Name - events ! AvatarServiceMessage(nameChannel, AvatarAction.DropSpecialItem()) + player.Zone.AvatarEvents ! AvatarServiceMessage(player.Name, AvatarAction.DropSpecialItem()) //alive or dead, as standard Infantry AvatarActor.saveAvatarData(avatar) AvatarActor.finalSavePlayerData(player)