Skip to content

Commit

Permalink
refactor(data): Check to see if an item is a weapon
Browse files Browse the repository at this point in the history
This gives us the ability to load weapon entites from our data
files.
  • Loading branch information
yngtdd committed Apr 10, 2022
1 parent 214e391 commit baff974
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/spawner/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ impl Templates {
}
});
}

if let Some(damage) = &template.base_damage {
commands.add_component(entity, Damage(*damage));

if template.entity_type == EntityType::Item {
commands.add_component(entity, Weapon{});
}
}
}
}

0 comments on commit baff974

Please sign in to comment.