- write(f, 'THING_POS %s %s' % (thing.id_,
- stringify_yx(thing.position)))
- write(f, 'THING_INVENTORY %s %s' %
- (thing.id_,','.join([str(i) for i in thing.inventory])))
+ write(f, 'THING_POS %s %s %s' % (thing.id_,
+ stringify_yx(thing.position[0]),
+ stringify_yx(thing.position[1])))
+ if hasattr(thing, 'health'):
+ write(f, 'THING_HEALTH %s %s' % (thing.id_, thing.health))
+ if len(thing.inventory) > 0:
+ write(f, 'THING_INVENTORY %s %s' %
+ (thing.id_,','.join([str(i) for i in thing.inventory])))
+ else:
+ write(f, 'THING_INVENTORY %s ,' % thing.id_)