diff options
| author | troido <troido@protonmail.com> | 2020-04-16 22:11:00 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-16 22:11:00 +0200 |
| commit | 608918af8174e9afb761cdd2ad46e489b21c5f4e (patch) | |
| tree | d4ebfc375b1a4af5211f2aa332c1d8698151da45 /src/systems | |
| parent | 4e144009aad9255af1e83970fc16fdafe3e79e83 (diff) | |
don't spread stones dropped from destroyed walls
Diffstat (limited to 'src/systems')
| -rw-r--r-- | src/systems/droploot.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/systems/droploot.rs b/src/systems/droploot.rs index fcd104b..604f29f 100644 --- a/src/systems/droploot.rs +++ b/src/systems/droploot.rs @@ -39,8 +39,10 @@ impl <'a> System<'a> for DropLoot{ if triggerbox.has_message(&[Trigger::Die, Trigger::Loot]) { for (template, chance) in &loot.loot { if *chance > rand::thread_rng().gen_range(0.0, 1.0) { + let pos = if loot.spread { + pick_position(position.pos, &ground, &flags) + } else {position.pos}; // todo: better error handling - let pos = pick_position(position.pos, &ground, &flags); new.create(pos, &template).unwrap(); } } |
