/
lib/banish/
lib/d/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/doc/examples/
lib/doc/examples/armour/
lib/doc/examples/contain/
lib/doc/examples/food/
lib/doc/examples/magic/
lib/doc/examples/monster/
lib/doc/examples/room/
lib/doc/examples/weapons/
lib/function/
lib/include/
lib/include/fn_specs/
lib/include/skills/
lib/info/
lib/inherit/base/
lib/log/
lib/manuals/312/
lib/news/
lib/obj/party/
lib/objects/components/
lib/open/
lib/open/library/
lib/open/party/
lib/players/
lib/players/zilanthius/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/obj/
lib/room/city/shop/
lib/room/death/
lib/room/registry/
lib/secure/
lib/secure/UDP_CMD_DIR/
lib/skills/
lib/skills/fighter/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/players/
/* follower */

inherit "obj/shadows/shadow";

object who;
object follower;
status follow_self_stop;

void follow(object arg1, object arg2) {
  who = arg1;
  follower = arg2;
  shadow_object(who);
}

status move_player(string dest, mixed opt, status safe) {
  status flag;
  string tmp;

  if(follow_self_stop) {
    destruct(this_object());
    return 0; 
  }
  follow_self_stop = 1;
  flag = (status)who->move_player(dest,opt,safe);
  if(!follower) {
    destruct(this_object());
    return flag;
  }
  if(dest) {
    sscanf(dest,"%s#%s",dest,tmp);

    command(dest, follower); /*why this instead of follower->move_player()*/
  }                          /*there maybe extra things to do. eg. pub    */
  follow_self_stop = 0;
  if(!present(follower, environment(who))) {
    destruct(this_object());
  }
  return flag;
}

object query_follow_object() { return this_object(); }