Skip to content

Commit 569c971

Browse files
Merge pull request #488 from lethal-guitar/fix-firebomb-assertion
Fix assertion when shooting a bomb that has already exploded
2 parents 1f6c023 + 5a7f6f5 commit 569c971

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/game_logic/interactive/item_container.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ void NapalmBomb::update(
150150

151151
if (mFramesElapsed >= 31) {
152152
explode(d, entity);
153+
154+
// Remove the shootable to prevent explode() being called twice
155+
// in case the timeout happens on the same frame as the bomb being hit
156+
// by a shot.
157+
entity.remove<game_logic::components::Shootable>();
153158
}
154159
break;
155160

0 commit comments

Comments
 (0)