diff --git a/common/src/main/scala/net/psforever/objects/definition/ExoSuitDefinition.scala b/common/src/main/scala/net/psforever/objects/definition/ExoSuitDefinition.scala index da957db9..0c65b55b 100644 --- a/common/src/main/scala/net/psforever/objects/definition/ExoSuitDefinition.scala +++ b/common/src/main/scala/net/psforever/objects/definition/ExoSuitDefinition.scala @@ -110,6 +110,20 @@ class ExoSuitDefinition(private val suitType : ExoSuitType.Value) extends BasicD } def Use : ExoSuitDefinition = this + + def canEqual(other: Any): Boolean = other.isInstanceOf[ExoSuitDefinition] + + override def equals(other: Any): Boolean = other match { + case that: ExoSuitDefinition => + (that canEqual this) && + suitType == that.suitType + case _ => false + } + + override def hashCode(): Int = { + val state = Seq(suitType) + state.map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b) + } } class SpecialExoSuitDefinition(private val suitType : ExoSuitType.Value) extends ExoSuitDefinition(suitType) { diff --git a/common/src/main/scala/services/avatar/support/CorpseRemovalActor.scala b/common/src/main/scala/services/avatar/support/CorpseRemovalActor.scala index b0aece43..5c601294 100644 --- a/common/src/main/scala/services/avatar/support/CorpseRemovalActor.scala +++ b/common/src/main/scala/services/avatar/support/CorpseRemovalActor.scala @@ -3,6 +3,7 @@ package services.avatar.support import net.psforever.objects.guid.{GUIDTask, TaskResolver} import net.psforever.objects.Player +import net.psforever.types.ExoSuitType import services.{RemoverActor, Service} import services.avatar.{AvatarAction, AvatarServiceMessage} @@ -28,6 +29,9 @@ class CorpseRemovalActor extends RemoverActor { def ClearanceTest(entry : RemoverActor.Entry) : Boolean = !entry.zone.Corpses.contains(entry.obj) def DeletionTask(entry : RemoverActor.Entry) : TaskResolver.GiveTask = { - GUIDTask.UnregisterPlayer(entry.obj.asInstanceOf[Player])(entry.zone.GUID) + val player = entry.obj.asInstanceOf[Player] + val task = GUIDTask.UnregisterPlayer(player)(entry.zone.GUID) + player.ExoSuit = ExoSuitType.Standard + task } } diff --git a/common/src/test/scala/objects/PlayerControlTest.scala b/common/src/test/scala/objects/PlayerControlTest.scala index 6092b610..2fa7419a 100644 --- a/common/src/test/scala/objects/PlayerControlTest.scala +++ b/common/src/test/scala/objects/PlayerControlTest.scala @@ -467,7 +467,7 @@ class PlayerControlDeathStandingTest extends ActorTest { assert( msg_avatar(7) match { case AvatarServiceMessage("test", AvatarAction.DestroyDisplay(killer, victim, _, _)) - if killer == player1Source && victim == PlayerSource(player2) => true + if killer.Name.equals(player1.Name) && victim.Name.equals(player2.Name) => true case _ => false } ) @@ -585,7 +585,7 @@ class PlayerControlDeathSeatedTest extends ActorTest { assert( msg_avatar(8) match { case AvatarServiceMessage("test", AvatarAction.DestroyDisplay(killer, victim, _, _)) - if killer == player1Source && victim == PlayerSource(player2) => true + if killer.Name.equals(player1.Name) && victim.Name.equals(player2.Name) => true case _ => false } )