Skip to content
Snippets Groups Projects
Commit a3749292 authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Fixed: Burn no longer continues after taking things out of equipment, can take...

Fixed: Burn no longer continues after taking things out of equipment, can take things out of cooking equipment again
parent 9c20e0a9
No related branches found
No related tags found
No related merge requests found
Pipeline #45567 passed
......@@ -234,7 +234,9 @@ class CookingEquipment(Item):
def can_combine(self, other) -> bool:
# already cooking or nothing to combine
if other is None:
if other is None or (
isinstance(other, CookingEquipment) and not other.content_list
):
return False
if any(
......@@ -260,6 +262,7 @@ class CookingEquipment(Item):
self.content_list.extend(other.content_list)
return_value = other
other.reset_content()
other.reset()
elif isinstance(other, list):
self.content_list.extend(other)
else:
......@@ -334,6 +337,7 @@ class CookingEquipment(Item):
"""Release the content when the player "picks up" the equipment with a plate in the hands"""
content = self.content_list
self.reset_content()
self.reset()
return content
@property
......
......@@ -725,6 +725,7 @@ async def websocket_player_endpoint(websocket: WebSocket, client_id: str):
def main(host: str, port: int, manager_ids: list[str]):
setup_logging()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
environment_handler.extend_allowed_manager(manager_ids)
......
......@@ -16,7 +16,7 @@ import numpy as np
import numpy.typing as npt
from overcooked_simulator.counters import Counter
from overcooked_simulator.game_items import Item, Plate, ItemType
from overcooked_simulator.game_items import Item, ItemType
from overcooked_simulator.state_representation import PlayerState
log = logging.getLogger(__name__)
......@@ -165,8 +165,8 @@ class Player:
log.debug(
f"Self: {self.holding}, {counter.__class__.__name__}: {counter.occupied_by}"
)
if isinstance(self.holding, Plate):
log.debug(self.holding.clean)
# if isinstance(self.holding, Plate):
# log.debug(self.holding.clean)
def perform_interact_start(self, counter: Counter):
"""Starts an interaction with the counter. Should be called for a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment