Skip to content

Commit

Permalink
Merge pull request #121 from BlackCrawler/fix-crash-#85
Browse files Browse the repository at this point in the history
Fix another crash (#85)
  • Loading branch information
steamroller-airmash committed Jul 31, 2019
2 parents 5df9840 + 45b64c8 commit 425709d
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -13,6 +13,7 @@ pub struct TriggerUpdate;
#[derive(SystemData)]
pub struct TriggerUpdateData<'a> {
force_update: WriteStorage<'a, ForcePlayerUpdate>,
entities: Entities<'a>,
}

impl EventHandlerTypeProvider for TriggerUpdate {
Expand All @@ -23,6 +24,10 @@ impl<'a> EventHandler<'a> for TriggerUpdate {
type SystemData = TriggerUpdateData<'a>;

fn on_event(&mut self, evt: &PlayerPowerup, data: &mut Self::SystemData) {
if !data.entities.is_alive(evt.player) {
return;
}

data.force_update
.insert(evt.player, ForcePlayerUpdate)
.unwrap();
Expand Down

0 comments on commit 425709d

Please sign in to comment.