Mercurial > skaapsteker
changeset 222:2cbeeef5867c
Fix npc tester (again).
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Thu, 07 Apr 2011 01:15:47 +0200 |
parents | 9e2949210c07 |
children | f675abd90529 |
files | scripts/npc-test |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/npc-test Thu Apr 07 01:14:42 2011 +0200 +++ b/scripts/npc-test Thu Apr 07 01:15:47 2011 +0200 @@ -12,10 +12,10 @@ from skaapsteker.gamestate import GameState -def run(npc_file): +def run(npc_name): game = GameState("game.json") - name = os.path.splitext(os.path.basename(npc_file))[0] - dsm = DSM(name, game.world, npc_file) + npc = getattr(game.world.npcs, npc_name) + dsm = DSM(npc_name, game.world, npc.dsm, npc.state) print "States:" print "-------" @@ -42,7 +42,7 @@ def main(): - p = optparse.OptionParser(usage="%prog [options] <npc json state file>") + p = optparse.OptionParser(usage="%prog [options] <npc name>") opts, args = p.parse_args() if len(args) != 1: p.error("Must provide an npc json file")