Fixed attribute read locks
authorAri Johnson <ari@theari.com>
Thu, 14 Feb 2008 15:14:37 +0000 (15:14 +0000)
committerAri Johnson <ari@cobramush.org>
Wed, 4 Apr 2007 05:49:46 +0000 (05:49 +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 636a09ff524b9f7a66d29f72a205fa212332eb9c..31087d12c74a97837573f054c3734036476b0ec8 100644 (file)
@@ -2040,10 +2040,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;
@@ -2067,21 +2063,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. */