Core: skip second sanity check when pushing an item into a location (-O) (#745)
This commit is contained in:
parent
122590fc68
commit
6e0a0c5c4a
|
@ -389,20 +389,14 @@ class MultiWorld():
|
||||||
self.state.collect(item, True)
|
self.state.collect(item, True)
|
||||||
|
|
||||||
def push_item(self, location: Location, item: Item, collect: bool = True):
|
def push_item(self, location: Location, item: Item, collect: bool = True):
|
||||||
if not isinstance(location, Location):
|
assert location.can_fill(self.state, item, False), f"Cannot place {item} into {location}."
|
||||||
raise RuntimeError(
|
location.item = item
|
||||||
'Cannot assign item %s to invalid location %s (player %d).' % (item, location, item.player))
|
item.location = location
|
||||||
|
item.world = self # try to not have this here anymore and create it with item?
|
||||||
|
if collect:
|
||||||
|
self.state.collect(item, location.event, location)
|
||||||
|
|
||||||
if location.can_fill(self.state, item, False):
|
logging.debug('Placed %s at %s', item, location)
|
||||||
location.item = item
|
|
||||||
item.location = location
|
|
||||||
item.world = self # try to not have this here anymore
|
|
||||||
if collect:
|
|
||||||
self.state.collect(item, location.event, location)
|
|
||||||
|
|
||||||
logging.debug('Placed %s at %s', item, location)
|
|
||||||
else:
|
|
||||||
raise RuntimeError('Cannot assign item %s to location %s.' % (item, location))
|
|
||||||
|
|
||||||
def get_entrances(self) -> List[Entrance]:
|
def get_entrances(self) -> List[Entrance]:
|
||||||
if self._cached_entrances is None:
|
if self._cached_entrances is None:
|
||||||
|
|
Loading…
Reference in New Issue