diff options
| author | troido <troido@protonmail.com> | 2020-09-26 14:05:14 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-09-26 14:05:14 +0200 |
| commit | 9b7e3d14b3f35163199ed704ae35544fa658931e (patch) | |
| tree | 9ad3623420f34b48f538ff2ceca6e3a277f16758 /src/systems/spawn.rs | |
| parent | 450cf9331803532cb0e3a002fec17d12be18abd6 (diff) | |
spawned entities are now saved but not spawned again until removed
Diffstat (limited to 'src/systems/spawn.rs')
| -rw-r--r-- | src/systems/spawn.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systems/spawn.rs b/src/systems/spawn.rs index f0a7aaa..284c2ab 100644 --- a/src/systems/spawn.rs +++ b/src/systems/spawn.rs @@ -49,6 +49,9 @@ impl <'a> System<'a> for Spawn { } let mut rng = rand::thread_rng(); for (entity, spawner, position, triggerbox) in (&entities, &mut spawners, &positions, &triggerboxes).join() { + if spawner.clan.name == "" { + spawner.clan.name = format!("$random({},{},{})", position.pos.x, position.pos.y, spawner.template.name.0); + } if triggerbox.has_message(&[Trigger::Spawn]) { if *clan_nums.get(&spawner.clan).unwrap_or(&0) < spawner.amount { if spawner.saturated { |
