Skip to content

Commit

Permalink
Fix: Destroy bomb sprite when bomber plane destroyed before dropping
Browse files Browse the repository at this point in the history
  • Loading branch information
lethal-guitar committed Jan 12, 2019
1 parent a97ce0a commit 76d4ab6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/game_logic/ai/bomber_plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ void BomberPlane::update(
}


void BomberPlane::onKilled(
GlobalDependencies&,
GlobalState&,
const base::Point<float>&,
entityx::Entity
) {
if (mBombSprite) {
mBombSprite.destroy();
}
}


void BigBomb::update(
GlobalDependencies& d,
GlobalState& s,
Expand Down
6 changes: 6 additions & 0 deletions src/game_logic/ai/bomber_plane.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ struct BomberPlane {
bool isOnScreen,
entityx::Entity entity);

void onKilled(
GlobalDependencies& dependencies,
GlobalState& state,
const base::Point<float>& inflictorVelocity,
entityx::Entity entity);

State mState;
entityx::Entity mBombSprite;
};
Expand Down

0 comments on commit 76d4ab6

Please sign in to comment.