From a8421258d2451c0389e770ecdb443a8694e37910 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 14 Feb 2020 21:52:40 +0000 Subject: [PATCH] Always check player has default furniture, igloo and location --- houdini/handlers/play/igloo.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/houdini/handlers/play/igloo.py b/houdini/handlers/play/igloo.py index 8e2489e..13458be 100644 --- a/houdini/handlers/play/igloo.py +++ b/houdini/handlers/play/igloo.py @@ -155,6 +155,13 @@ async def igloos_load(server): server.logger.info(f'Loaded {len(server.locations)} igloo locations') server.logger.info(f'Loaded {len(server.flooring)} igloo flooring') + +DefaultFurnitureItems = [787, 788, 790, 792, 793] +DefaultIglooId = 1 +DefaultLocationId = 1 + + +@handlers.handler(XMLPacket('login'), priority=Priority.Low) @handlers.allow_once async def load_igloo_inventory(p): p.igloos = await PenguinIglooCollection.get_collection(p.id) @@ -163,6 +170,16 @@ async def load_igloo_inventory(p): p.flooring = await PenguinFlooringCollection.get_collection(p.id) p.locations = await PenguinLocationCollection.get_collection(p.id) + if DefaultIglooId not in p.igloos: + await p.igloos.insert(igloo_id=DefaultIglooId) + + if DefaultLocationId not in p.locations: + await p.locations.insert(location_id=DefaultLocationId) + + for default_item_id in DefaultFurnitureItems: + if default_item_id not in p.furniture: + await p.furniture.insert(furniture_id=default_item_id) + @handlers.handler(XTPacket('g', 'gm')) @handlers.cooldown(1)