summaryrefslogtreecommitdiff
path: root/src/systems/spawn.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-03-03 16:28:19 +0100
committertroido <troido@protonmail.com>2020-03-03 16:28:19 +0100
commitb98ea15acbebe8815f9316b5a8ef3393fdd1c3e6 (patch)
tree38481d682bf83706784daa31b0d54e2b53ca17d3 /src/systems/spawn.rs
parent0042d08cbd71caace7d8ed0b8fd47c6d3a263e60 (diff)
monsters tend to stay around their home
Diffstat (limited to 'src/systems/spawn.rs')
-rw-r--r--src/systems/spawn.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/systems/spawn.rs b/src/systems/spawn.rs
index 838899c..27dcb1f 100644
--- a/src/systems/spawn.rs
+++ b/src/systems/spawn.rs
@@ -14,7 +14,8 @@ use crate::{
components::{
Position,
Spawner,
- Clan
+ Clan,
+ Home
},
resources::{NewEntities, TimeStamp},
componentwrapper::ComponentWrapper
@@ -45,6 +46,7 @@ impl <'a> System<'a> for Spawn {
spawner.last_spawn = None;
let mut preent = new.encyclopedia.construct(&spawner.template).expect("unable to spawn entity from spawner");
preent.push(ComponentWrapper::Clan(spawner.clan.clone()));
+ preent.push(ComponentWrapper::Home(Home{home: position.pos}));
new.to_build.push((position.pos, preent));
}
} else {