Skip to content

Commit

Permalink
Fix spawned monsters not falling until they move
Browse files Browse the repository at this point in the history
Not the most ideal looking spot for this but its the only place all the calls I could find filter down to
  • Loading branch information
Procyonae committed Dec 11, 2024
1 parent 0235161 commit 6d78f96
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5179,7 +5179,11 @@ monster *game::place_critter_around( const shared_ptr_fast<monster> &mon,
return nullptr;
}
mon->spawn( *where );
return critter_tracker->add( mon ) ? mon.get() : nullptr;
if( critter_tracker->add( mon ) ) {
mon->gravity_check();
return mon.get();
}
return nullptr;
}

monster *game::place_critter_within( const mtype_id &id, const tripoint_range<tripoint> &range )
Expand All @@ -5201,7 +5205,11 @@ monster *game::place_critter_within( const shared_ptr_fast<monster> &mon,
return nullptr;
}
mon->spawn( *where );
return critter_tracker->add( mon ) ? mon.get() : nullptr;
if( critter_tracker->add( mon ) ) {
mon->gravity_check();
return mon.get();
}
return nullptr;
}

size_t game::num_creatures() const
Expand Down

0 comments on commit 6d78f96

Please sign in to comment.