Fixed attribute read locks
authorAri Johnson <ari@theari.com>
Thu, 14 Feb 2008 15:14:37 +0000 (15:14 +0000)
committerAri Johnson <ari@theari.com>
Thu, 24 Mar 2011 15:58:45 +0000 (15:58 +0000)
(cherry picked from commit 84cd46099561db6299438a5da32994fcdfd7fc26)

game/txt/changes/0.72p4
src/attrib.c

index 07b80c6be7323917d715fc786e98d90736de6481..f8c1a38b9425cee62ab1364405d9e7d0dfc3f710 100644 (file)
@@ -28,4 +28,5 @@ CobraMUSH Version 0.72p4
     * Fixed possible crash in process_commands() [AEJ]
     * Fixed possible crash in trim_space_sep() [AEJ]
     * Fixed attribute flag mortal_dark [AEJ]
+    * Fixed attribute read locks [AEJ]
 
index d4e15e1e68191427fd00eceae5836720c0f33417..7958479dda7bfa4d77604ee98b432407de113349 100644 (file)
@@ -2098,10 +2098,6 @@ can_read_attr_internal(dbref player, dbref obj, ATTR * atr)
 
   visible = (player == NOTHING);
 
-  /* Do an easy yes.. If they can write, it they can read it */
-  if (Can_Write_Attr(player, obj, atr))
-    return 1;
-
   /* Evaluate read lock first here */
   if (AL_RLock(atr) == TRUE_BOOLEXP)
     r_lock = 1;
@@ -2125,21 +2121,15 @@ can_read_attr_internal(dbref player, dbref obj, ATTR * atr)
 
   /* Take an easy out if there is one... */
   /* If we can't see the attribute itself, then that's easy. */
-  if (AF_Internal(atr) || (!Admin(player) && (AF_Mdark(atr) ||
-                                              !(cansee
-                                                ||
-                                                ((AF_Visual(atr)
-                                                  ||
-                                                  ((AL_RLock(atr) !=
-                                                    TRUE_BOOLEXP)
-                                                   && r_lock))
-                                                 && (!AF_Nearby(atr)
-                                                     || canlook))
-                                                || (!visible
-                                                    && !Mistrust(player)
-                                                    &&
-                                                    (Owner(AL_CREATOR(atr))
-                                                     == Owner(player)))))))
+  if (AF_Internal(atr)
+      || (!Admin(player)
+          && (AF_Mdark(atr)
+             || !(cansee
+                  || ((AF_Visual(atr)
+                       || ((AL_RLock(atr) != TRUE_BOOLEXP) && r_lock))
+                      && (!AF_Nearby(atr) || canlook))
+             || (!visible && !Mistrust(player)
+                 && (Owner(AL_CREATOR(atr)) == Owner(player)))))))
     return 0;
 
   /* If the attribute isn't on a branch, then that's also easy. */