Skip to content

Commit d17572b

Browse files
fix: Apply possible fix for teammate leaving before start
1 parent 1301257 commit d17572b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,14 @@ object DungeonListener {
345345
teammate.classLevel = classLevel
346346
}
347347

348-
teammate.tabEntryIndex = pos
348+
if (teammate.tabEntryIndex != pos) {
349+
println("Updating ${teammate.playerName} tab entry index from ${teammate.tabEntryIndex} to $pos")
350+
team.values.find { it.tabEntryIndex == pos }?.let {
351+
println("Removing $it from team due to tab entry index collision")
352+
team.remove(it.playerName)
353+
}
354+
teammate.tabEntryIndex = pos
355+
}
349356

350357
teammate.player = mc.theWorld.playerEntities.find {
351358
it.name == teammate.playerName && it.uniqueID.version() == 4

0 commit comments

Comments
 (0)