This commit is contained in:
ScrawnyRonnie 2024-01-02 21:22:48 -05:00
parent 1f6e3d741e
commit 69b5dec127

View file

@ -974,6 +974,7 @@ class SquadService extends Actor {
def CloseSquad(squad: Squad): Unit = { def CloseSquad(squad: Squad): Unit = {
val guid = squad.GUID val guid = squad.GUID
val membership = squad.Membership.zipWithIndex val membership = squad.Membership.zipWithIndex
val factionListings = publishedLists(squad.Faction)
val (updateMembers, updateIndices) = membership.collect { val (updateMembers, updateIndices) = membership.collect {
case (member, index) if member.CharId > 0 => case (member, index) if member.CharId > 0 =>
((member, member.CharId, index, subs.UserEvents.get(member.CharId)), (member.CharId, index)) ((member, member.CharId, index, subs.UserEvents.get(member.CharId)), (member.CharId, index))
@ -1012,6 +1013,13 @@ class SquadService extends Actor {
UpdateSquadListWhenListed(features.Stop, None) UpdateSquadListWhenListed(features.Stop, None)
//I think this is right, otherwise squadFeatures will never be empty and TryResetSquadId will not reset to 1 //I think this is right, otherwise squadFeatures will never be empty and TryResetSquadId will not reset to 1
squadFeatures.remove(guid) squadFeatures.remove(guid)
//for the rare case of a phantom squad that no longer exists but is still on the publishedLists
factionListings.find(_ == guid) match {
case Some(squad) =>
val index = factionListings.indexOf(squad)
factionListings.remove(index)
case None =>
}
} }
/** /**
@ -1125,7 +1133,8 @@ class SquadService extends Actor {
} }
subs.SquadEvents.unsubscribe(sender) //just to make certain subs.SquadEvents.unsubscribe(sender) //just to make certain
searchData.remove(charId) searchData.remove(charId)
TryResetSquadId() //todo turn this back on. See PR 1157 for why it was commented out.
//TryResetSquadId()
} }
/** /**