_unref.c

tmi2_fluffos_v2/lib/cmds/object/_unref.c · 624 B

From the archive tmi2_fluffos_v2.zip

Download the archive   « Back to the archive contents

#include <mudlib.h>
#include <daemons.h>

inherit DAEMON;
inherit REF_D;

#define SYNTAX "Syntax: unref <ref_name>\n"

int cmd_unref( string a )
{
  mapping refs;

  if( !a ) { notify_fail( SYNTAX ); return 0; }
  refs = this_player()-> query( "ref" );
  if( !refs ) refs = ([ ]);
  if( undefinedp( refs[a] ) )
  {
    notify_fail( "\"" + a + "\" is not a reference.\n" );
    return 0;
  }
  map_delete( refs, a );
  refs = this_player()-> set( "ref", refs );
  write( "Reference \"" + a + "\" deleted.\n" );
  return 1;
}

int help() 
{
  write( SYNTAX +
    "Effect: unsets reference <ref_name>\n"+
  "" );
  return 1;
}

Site Stats

Snippets: 1791
Codebases: 571