# HG changeset patch # User Simon Cross # Date 1302131747 -7200 # Node ID 2cbeeef5867c45a88e3b48c7b325507c8df41964 # Parent 9e2949210c07cc15794bb359046f8ee7ebf7d6fe Fix npc tester (again). diff -r 9e2949210c07 -r 2cbeeef5867c scripts/npc-test --- 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] ") + p = optparse.OptionParser(usage="%prog [options] ") opts, args = p.parse_args() if len(args) != 1: p.error("Must provide an npc json file")