mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 10:25:06 -04:00
fix passengers not removing vehicle when destroyed
This commit is contained in:
parent
768f1f8f9b
commit
ba0adce043
@ -41,7 +41,9 @@ class EntityDestroyS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||
override fun handle(connection: PlayConnection) {
|
||||
for (entityId in entityIds) {
|
||||
val entity = connection.world.entities[entityId] ?: continue
|
||||
entity.attachment.vehicle?.attachment?.passengers?.remove(entity)
|
||||
for (passenger in entity.attachment.passengers) {
|
||||
passenger.attachment.vehicle = null
|
||||
}
|
||||
|
||||
connection.world.entities.remove(entityId)
|
||||
connection.events.fire(EntityDestroyEvent(connection, entity))
|
||||
|
Loading…
x
Reference in New Issue
Block a user