aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-09-27 11:35:22 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-09-27 11:35:22 -0400
commit48cd8419bb274345fe386d47843f9aa16910e090 (patch)
treea0e31b43b0f38d6de8d3879b29563cfee1b19ced /src/world.cpp
parent8be1f74e878950cbbac3f05451341fc18892518b (diff)
lua-scripted wandering
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 7904c4f..9f57b87 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -350,9 +350,10 @@ void WorldSystem::loader(void)
entity.assign<Dialog>(wxml, abcd);
else if (tname == "Grounded")
entity.assign<Grounded>(); // no need to pass xmls...
- else if (tname == "Wander")
- entity.assign<Wander>();
- else if (tname == "Hop")
+ else if (tname == "Wander") {
+ auto script = abcd->GetText();
+ entity.assign<Wander>(script != nullptr ? script : "");
+ } else if (tname == "Hop")
entity.assign<Hop>();
else if (tname == "Health")
entity.assign<Health>(wxml, abcd);