changeset 190:e4b466368b89

Fix dialogue.
author Simon Cross <hodgestar@gmail.com>
date Wed, 06 Apr 2011 21:19:26 +0200
parents 9d08f99b5ddf
children 993f4f55eb93
files skaapsteker/dialogue.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/skaapsteker/dialogue.py	Wed Apr 06 21:14:26 2011 +0200
+++ b/skaapsteker/dialogue.py	Wed Apr 06 21:19:26 2011 +0200
@@ -15,12 +15,11 @@
            Something to allow states to introspect the game state with.
        """
 
-    def __init__(self, npc_name, world):
+    def __init__(self, json_filename, world):
         self.world = world
-        world.npcs[npc_name] = self
         self.state = "start"
         self.states = AttrDict()
-        src = json.loads(data.load('npcs/' + npc_name + '.json').read())
+        src = json.loads(data.load(json_filename).read())
         for state, state_src in src.iteritems():
             pseudo_path = [json_filename, state]
             self.states[state] = DsmState(state, state_src, pseudo_path)