Fix igloo owner rejoining its open igloo (#102)

This commit is contained in:
Thales César Giriboni 2024-10-13 12:44:10 -03:00 committed by GitHub
parent e23a7ecf2e
commit 95a7b25233
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -147,7 +147,7 @@ async def create_temporary_room(p, penguin_id):
igloo = None igloo = None
if penguin_id in p.server.penguins_by_id: if penguin_id in p.server.penguins_by_id:
igloo_owner = p.server.penguins_by_id[penguin_id] igloo_owner = p.server.penguins_by_id[penguin_id]
igloo = igloo_owner.igloo_rooms[igloo_owner.igloo] igloo = p.server.igloos_by_penguin_id.get(igloo_owner.id, igloo_owner.igloo_rooms[igloo_owner.igloo])
p.server.igloos_by_penguin_id[penguin_id] = igloo p.server.igloos_by_penguin_id[penguin_id] = igloo
elif penguin_id not in p.server.igloos_by_penguin_id: elif penguin_id not in p.server.igloos_by_penguin_id:
igloo = await PenguinIglooRoom.load(parent=Penguin.on(Penguin.igloo == PenguinIglooRoom.id)) \ igloo = await PenguinIglooRoom.load(parent=Penguin.on(Penguin.igloo == PenguinIglooRoom.id)) \