From: nveid <nveid@cobramush.org>
Date: Mon, 9 Apr 2007 06:07:28 +0000 (+0000)
Subject: Requires control ability of an object to add @function's off of it now
X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=e84a27d8b18d8e8f079bbccd95c7eaf2a0b24ba4;p=cobramush.git

Requires control ability of an object to add @function's off of it now
(cherry picked from commit 1976212f3cb115378d184fe04919aa06f2c179a5)
---

diff --git a/game/txt/changes/0.73 b/game/txt/changes/0.73
index 7ce81af..e124638 100644
--- a/game/txt/changes/0.73
+++ b/game/txt/changes/0.73
@@ -6,6 +6,8 @@ CobraMUSH Version 0.73
 
  Minor:
    * Improved how power bitfields are stored. [RLB]
+   * Adding Global functions now requires the executor have
+     controlling ability over the object the function is on. [RLB]
  Flags:
    * LEAVE_BEHIND - When a player leaves the location of 
      someone they're flowing with this flag it unfollows
diff --git a/src/function.c b/src/function.c
index 9a20512..f0e86c6 100644
--- a/src/function.c
+++ b/src/function.c
@@ -1191,12 +1191,12 @@ do_function(dbref player, char *name, char *argv[], int preserve)
     return;
   }
   /* find the object. For some measure of security, the player must
-   * be able to examine it.
+   * be able to controls it.
    */
   if ((thing = noisy_match_result(player, argv[1], NOTYPE, MAT_EVERYTHING))
       == NOTHING)
     return;
-  if (!Can_Examine(player, thing)) {
+  if(controls(player, thing)) {
     notify(player, T("No permission to examine object."));
     return;
   }