From: Rick Bird Date: Wed, 13 Apr 2011 03:30:49 +0000 (-0400) Subject: General clean-up in mushdb.h.. Several macros not used taken out, as X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=18046d18f656bab6146356290974cb74e769b1ed;p=cobramush.git General clean-up in mushdb.h.. Several macros not used taken out, as a well as code thats been commented for years. --- diff --git a/hdrs/mushdb.h b/hdrs/mushdb.h index 1f28902..a49fb07 100644 --- a/hdrs/mushdb.h +++ b/hdrs/mushdb.h @@ -10,24 +10,20 @@ #include "flags.h" #define LastMod(x) (db[x].lastmod) -#define TC_Builder(x) (command_check_byname(x, "@dig")) +#define TC_Builder(x) (has_power(x, "Builder")) #define Builder(x) OOREF(x,TC_Builder(x), TC_Builder(ooref)) #define TC_CanModify(x,y) (x == y || div_powover(x,y,"Modify")) #define CanModify(x,y) OOREF(x,TC_CanModify(x,y), TC_CanModify(ooref,y)) #define TC_Site(x) (God(x) || div_powover(x,x,"Site") || (Inherit_Powers(x) && div_powover(Owner(x),Owner(x),"Site"))) #define Site(x) OOREF(x, TC_Site(x), TC_Site(ooref)) #define Guest(x) (LEVEL(x) == LEVEL_GUEST) /* Guest needs no twincheck */ -#define TC_Tel_Anywhere(x) (God(x)) -#define Tel_Anywhere(x) OOREF(x,TC_Tel_Anywhere(x),TC_Tel_Anywhere(ooref)) -#define Tel_Anything(x) (God(x)) /* This needs no twincheck. This is already accounted for in dbdefs.h */ -#define Tel_Where(x,y) (Tel_Anywhere(x) || OOREF(x,div_powover(x,y,"Tel_Place"),div_powover(ooref,y,"Tel_Place"))) -#define Tel_Thing(x,y) (Tel_Anything(x) || OOREF(x,div_powover(x,y,"Tel_Thing"),div_powover(ooref,y,"Tel_Thing"))) +#define Tel_Where(x,y) ((x == GOD) || OOREF(x,div_powover(x,y,"Tel_Place"),div_powover(ooref,y,"Tel_Place"))) +#define Tel_Thing(x,y) ((x == GOD) || OOREF(x,div_powover(x,y,"Tel_Thing"),div_powover(ooref,y,"Tel_Thing"))) #define TC_RPTEL(x) (div_powover(x,x, "RPTel") || (Inherit_Powers(x) && div_powover(Owner(x), Owner(x), "RPTel"))) #define Can_RPTEL(x) OOREF(x,TC_RPTEL(x), TC_RPTEL(x)) #define Can_BCREATE(x) (OOREF(x,div_powover(x,x, "BCreate"), div_powover(ooref, ooref, "BCreate"))) #define See_All(x) (God(x)) -#define CanNewpass(x,y) OOREF(x,div_powover(x,y,"Newpass"), div_powover(ooref,y,"Newpass")) || OOREF(x,div_powover(x,y,"BCreate"),div_powover(x,y,"BCreate")) -/* #define CanSee(x,y) (God(x) || div_powover(x,y,POW_SEE_ALL)) */ +#define CanNewpass(x,y) OOREF(x,(div_powover(x,y,"Newpass") || div_powover(x,y,"Bcreate")),(div_powover(ooref,y,"Newpass") || div_powover(ooref,y,"BCreate"))) #define Prived(x) OOREF(x,div_powover(x,x,"Privilege"),div_powover(ooref,ooref,"Privilege")) #define Priv_Who(x) (OOREF(x,div_powover(x,x,"PrivWho"),div_powover(ooref,ooref, "PrivWho")) || Site(x)) #define Can_Hide(x) OOREF(x,div_powover(x,x,"Hide"),div_powover(ooref,ooref,"Hide")) @@ -41,7 +37,6 @@ #define Long_Fingers(x) OOREF(x,TC_Long_Fingers(x),TC_Long_Fingers(ooref)) #define CanRemote(x,y) OOREF(x,div_powover(x,y,"Remote"),div_powover(ooref,y,"Remote")) #define CanOpen(x,y) OOREF(x,div_powover(x,y,"Open"),div_powover(ooref,y,"Open")) -#define Link_Anywhere(x,y) OOREF(x,div_powover(x,y,"Link"),div_powover(ooref,y,"Link")) #define Can_Boot(x,y) OOREF(x,div_powover(x,y,"Boot"),div_powover(ooref,y,"Boot")) #define Do_Quotas(x,y) OOREF(x,div_powover(x,y,"Quota"),div_powover(ooref,y,"Quota")) #define Change_Quota(x,y) OOREF(x,div_powover(x,y,"SetQuotas"),div_powover(ooref,y,"SetQuotas")) @@ -49,7 +44,7 @@ #define HugeQueue(x) OOREF(x,div_powover(x,x,"Queue"),div_powover(ooref,ooref,"Queue")) #define LookQueue(x) OOREF(x,div_powover(x,x,"See_Queue"),div_powover(ooref,ooref,"See_Queue")) #define CanSeeQ(x,y) OOREF(x,div_powover(x,y,"See_Queue"),div_powover(ooref,y,"See_Queue")) - +#define CanLink(x,y) OOREF(x,div_powover(x,y,"Link"),div_powover(ooref,y,"Link")) #define HaltAny(x) (Director(x) && OOREF(x,div_powover(x,x,"Halt"),div_powover(ooref,ooref,"Halt"))) #define CanHalt(x,y) OOREF(x,div_powover(x,y,"Halt"),div_powover(ooref,y,"Halt")) #define CanNuke(x,y) OOREF(x,div_powover(x,y,"Nuke"),div_powover(ooref, y, "Nuke")) @@ -84,10 +79,12 @@ !(f->perms & (F_DARK | F_MDARK | F_DISABLED))) || \ ((div_cansee(p,t) && Admin(p)) && !(f->perms & (F_DARK | F_DISABLED))) || \ God(p))) + #define Can_See_Flag(p,t,f) OOREF(p,TC_Can_See_Flag(p,t,f),TC_Can_See_Flag(ooref,t,f)) /* Can p locate x? */ int unfindable(dbref); +#define CanSee(p,x) Can_Examine(p,x) #define TC_Can_Locate(p,x) \ (controls(p,x) || nearby(p,x) || CanSee(p,x) \ || (command_check_byname(p, "@whereis") && (IsPlayer(x) && !Unfind(x) \ @@ -98,8 +95,6 @@ int unfindable(dbref); #define TC_Can_Examine(p,x) (controls(p,x)|| \ div_cansee(p,x) || (Visual(x) && eval_lock(p,x,Examine_Lock))) #define Can_Examine(p,x) OOREF(p,TC_Can_Examine(p,x),TC_Can_Examine(ooref,x)) -#define CanSee(p,x) Can_Examine(p,x) - /***< UnUsed macro? * - RLB #define TC_can_link(p,x) (controls(p,x) || \ @@ -109,7 +104,7 @@ int unfindable(dbref); /* Can p link an exit to x? */ #define TC_can_link_to(p,x) \ (GoodObject(x) \ - && (controls(p,x) || Link_Anywhere(p,x) || \ + && (controls(p,x) || CanLink(p,x) || \ (LinkOk(x) && eval_lock(p,x,Link_Lock))) \ && (!NO_LINK_TO_OBJECT || IsRoom(x))) #define can_link_to(p,x) OOREF(p,TC_can_link_to(p,x),TC_can_link_to(ooref,x)) @@ -123,15 +118,6 @@ int unfindable(dbref); /* can p access attribute a on object x? */ #define TC_Can_Read_Attr(p,x,a) can_read_attr_internal(p,x,a) - /* (God(p) || (!AF_Internal(a) && !(AF_Mdark(a) && !Admin(p)) && \ - can_read_attr_internal((p), (x), (a)))) - -- - (CanSee(p,x) || Can_DivRead_Attr(p,x,a) || \ - (!((a)->flags & AF_MDARK) && \ - (controls(p,x) || ((a)->flags & AF_VISUAL) || \ - (Visual(x) && eval_lock(p,x,Examine_Lock)) || \ - (!Mistrust(p) && (Owner((a)->creator) == Owner(p))))))) - */ #define Can_Read_Attr(p,x,a) OOREF(p,TC_Can_Read_Attr(p,x,a), TC_Can_Read_Attr(ooref,x,a)) /** can p look at object x? */ @@ -156,20 +142,6 @@ int unfindable(dbref); #define TC_Can_Write_Attr_Ignore_Safe(p,x,a) can_write_attr_internal(p,x,a, 0) #define Can_Write_Attr_Ignore_Safe(p,x,a) \ OOREF(p,TC_Can_Write_Attr_Ignore_Safe(p,x,a), TC_Can_Write_Attr_Ignore_Safe(ooref,x,a)) - /* -#define Can_Write_Attr(p,x,a) \ - (God(p) || \ - (!((a)->flags & AF_INTERNAL) && \ - !((a)->flags & AF_SAFE) && \ - (((a)->creator == Owner(p)) || !((a)->flags & AF_LOCKED)) \ - )) -#define Can_Write_Attr_Ignore_Safe(p,x,a) \ - (God(p) || \ - (!((a)->flags & AF_INTERNAL) && \ - (((a)->creator == Owner(p)) || !((a)->flags & AF_LOCKED)) \ - )) - */ - /* Can p forward a message to x (via @forwardlist)? */ #define Can_Forward(p,x) \