Skip to content

Commit

Permalink
Added one extra safety check
Browse files Browse the repository at this point in the history
  • Loading branch information
marzojr committed Mar 11, 2021
1 parent 3929188 commit 4d71b42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions usecode/ucinternal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,11 @@ void Usecode_internal::set_item_shape(
gwin->add_dirty(item);
// Get chunk it's in.
Map_chunk *chunk = item->get_chunk();
if (!chunk) {
CERR("Object " << item << " not in chunk and not owned by another object");
item->set_shape(shape);
return;
}
Game_object_shared keep = item->shared_from_this();
chunk->remove(item); // Remove and add to update cache.
item->set_shape(shape);
Expand Down

0 comments on commit 4d71b42

Please sign in to comment.