const char * unparse_object(dbref player, dbref loc) { static char buf[BUFFER_LEN]; if (player == NOTHING) goto islog; if (Typeof(player) != TYPE_PLAYER) player = OWNER(player); islog: switch (loc) { case NOTHING: return "*NOTHING*"; case AMBIGUOUS: return "*AMBIGUOUS*"; case HOME: return "*HOME*"; default: if (loc < 0 || loc >= db_top) return "*INVALID*"; if ((player == NOTHING) || (!(FLAGS(player) & STICKY) && (can_link_to(player, NOTYPE, loc) || ((Typeof(loc) != TYPE_PLAYER) && (controls_link(player, loc) || (FLAGS(loc) & CHOWN_OK)))))) { /* show everything */ snprintf(buf, sizeof(buf), "%.*s(#%d%s)", (BUFFER_LEN / 2), NAME(loc), loc, unparse_flags(loc)); return buf; } else { /* show only the name */ return NAME(loc); } } }
const char * unparse_object(dbref player, dbref loc) { char tbuf[BUFFER_LEN]; if (Typeof(player) != TYPE_PLAYER) player = OWNER(player); switch (loc) { case NOTHING: return "*NOTHING*"; case AMBIGUOUS: return "*AMBIGUOUS*"; case HOME: return "*HOME*"; case NIL: return "*NIL*"; default: if (loc < 0 || loc >= db_top) #ifdef SANITY { sprintf(upb, "*INVALID*(#%d)", loc); return upb; } #else return "*INVALID*"; #endif #ifndef SANITY if (!(FLAGS(player) & STICKY) && (TMage(player) || POWERS(player) & POW_SEE_ALL || can_link_to(player, NOTYPE, loc) || controls_link(player, loc) || ((Typeof(loc) != TYPE_PLAYER) && (FLAGS(loc) & CHOWN_OK)) )) { /* show everything */ #endif sprintf(upb, "%s(#%d%s)", NAME(loc), loc, unparse_flags(loc, tbuf)); return upb; #ifndef SANITY } else { /* show only the name */ return NAME(loc); } #endif } }
const char * unparse_object(dbref player, dbref loc) { static char buf[BUFFER_LEN]; if (Typeof(player) != TYPE_PLAYER) player = OWNER(player); switch (loc) { case NOTHING: return "*NOTHING*"; case AMBIGUOUS: return "*AMBIGUOUS*"; case HOME: return "*HOME*"; default: if (loc < 0 || loc > db_top) #ifdef SANITY { sprintf(buf, "*INVALID*(#%d)", loc); return buf; } #else return "*INVALID*"; #endif #ifndef SANITY if (!(FLAGS(player) & STICKY) && (can_link_to(player, NOTYPE, loc) || ((Typeof(loc) != TYPE_PLAYER) && (controls_link(player, loc) || (FLAGS(loc) & CHOWN_OK))) )) { /* show everything */ #endif sprintf(buf, "%s(#%d%s)", PNAME(loc), loc, unparse_flags(loc)); return buf; #ifndef SANITY } else { /* show only the name */ return PNAME(loc); } #endif } }
const char * ansi_unparse_object(dbref player, dbref loc) { char tbuf[BUFFER_LEN], tbuf2[BUFFER_LEN]; if (Typeof(player) != TYPE_PLAYER) player = OWNER(player); switch (loc) { case NOTHING: return SYSNORMAL "*NOTHING*"; case AMBIGUOUS: return SYSPURPLE "*AMBIGUOUS*"; case HOME: return SYSWHITE "*HOME*"; case NIL: return SYSCYAN "*NIL*"; default: if (loc < 0 || loc >= db_top) { sprintf(upb, SYSRED "*INVALID(#%d)*", loc); return upb; } #ifndef SANITY if (!(FLAGS(player) & STICKY) && (TMage(player) || POWERS(player) & POW_SEE_ALL || POWERS(player) & POW_SEARCH || can_link_to(player, NOTYPE, loc) || controls_link(player, loc) || ((Typeof(loc) != TYPE_PLAYER) && (FLAGS(loc) & CHOWN_OK)) )) { #endif /* show everything */ sprintf(upb, "%s" SYSYELLOW "(#%d%s)", ansiname(loc, tbuf), loc, unparse_flags(loc, tbuf2)); return upb; #ifndef SANITY } else { /* show only the name */ return ansiname(loc, upb); } #endif } }
const char * ansi_unparse_object(dbref player, dbref loc) { char tbuf[BUFFER_LEN], tbuf2[BUFFER_LEN]; if (Typeof(player) != TYPE_PLAYER) player = OWNER(player); switch (loc) { case NOTHING: return CGLOOM "*NOTHING*"; case AMBIGUOUS: return CPURPLE "*AMBIGUOUS*"; case HOME: return CWHITE "*HOME*"; default: if (!OkObj(loc)) return CRED "*INVALID*"; #ifndef SANITY if (!(FLAGS(player) & STICKY) && (TMage(player) || can_link_to(player, NOTYPE, loc) || controls_link(player, loc) || ((Typeof(loc) != TYPE_PLAYER) && (FLAGS(loc) & CHOWN_OK)) )) { #endif /* show everything */ sprintf(upb, "%s" CYELLOW "(#%d%s)", ansiname(loc, tbuf), loc, unparse_flags(loc, tbuf2)); return upb; #ifndef SANITY } else { /* show only the name */ return ansiname(loc, upb); } #endif } }