summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagent.cpp44
-rw-r--r--indra/newview/llscriptruntimeperms.h4
2 files changed, 6 insertions, 42 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 66d24db15e..790c76e216 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -63,6 +63,7 @@
#include "llpaneltopinfobar.h"
#include "llparcel.h"
#include "llrendersphere.h"
+#include "llscriptruntimeperms.h"
#include "llsdmessage.h"
#include "llsdutil.h"
#include "llsky.h"
@@ -4173,48 +4174,7 @@ void LLAgent::stopCurrentAnimations()
if (mRegionp &&
gSavedSettings.getBOOL("RevokePermsOnStopAnimation"))
{
- typedef enum e_lscript_runtime_permissions
- {
- SCRIPT_PERMISSION_DEBIT,
- SCRIPT_PERMISSION_TAKE_CONTROLS,
- SCRIPT_PERMISSION_REMAP_CONTROLS,
- SCRIPT_PERMISSION_TRIGGER_ANIMATION,
- SCRIPT_PERMISSION_ATTACH,
- SCRIPT_PERMISSION_RELEASE_OWNERSHIP,
- SCRIPT_PERMISSION_CHANGE_LINKS,
- SCRIPT_PERMISSION_CHANGE_JOINTS,
- SCRIPT_PERMISSION_CHANGE_PERMISSIONS,
- SCRIPT_PERMISSION_TRACK_CAMERA,
- SCRIPT_PERMISSION_CONTROL_CAMERA,
- SCRIPT_PERMISSION_TELEPORT,
- SCRIPT_PERMISSION_EXPERIENCE,
- SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT,
- SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS,
- SCRIPT_PERMISSION_RETURN_OBJECTS,
- SCRIPT_PERMISSION_EOF
- } LSCRIPTRunTimePermissions;
-
- const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] =
- {
- (0x1 << 1), // SCRIPT_PERMISSION_DEBIT,
- (0x1 << 2), // SCRIPT_PERMISSION_TAKE_CONTROLS,
- (0x1 << 3), // SCRIPT_PERMISSION_REMAP_CONTROLS,
- (0x1 << 4), // SCRIPT_PERMISSION_TRIGGER_ANIMATION,
- (0x1 << 5), // SCRIPT_PERMISSION_ATTACH,
- (0x1 << 6), // SCRIPT_PERMISSION_RELEASE_OWNERSHIP,
- (0x1 << 7), // SCRIPT_PERMISSION_CHANGE_LINKS,
- (0x1 << 8), // SCRIPT_PERMISSION_CHANGE_JOINTS,
- (0x1 << 9), // SCRIPT_PERMISSION_CHANGE_PERMISSIONS
- (0x1 << 10),// SCRIPT_PERMISSION_TRACK_CAMERA
- (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA
- (0x1 << 12),// SCRIPT_PERMISSION_TELEPORT
- (0x1 << 13),// SCRIPT_PERMISSION_EXPERIENCE
- (0x1 << 14),// SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT
- (0x1 << 15),// SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS
- (0x1 << 16),// SCRIPT_PERMISSION_RETURN_OBJECTS
- };
-
- U32 permissions = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS];
+ U32 permissions = SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_TRIGGER_ANIMATION].permbit | SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS].permbit;
sendRevokePermissions(mRegionp->getRegionID(), permissions);
if (gAgentAvatarp->isSitting())
{ // Also stand up, since auto-granted sit animation permission has been revoked
diff --git a/indra/newview/llscriptruntimeperms.h b/indra/newview/llscriptruntimeperms.h
index 4a8e4288d2..51f57afdc9 100644
--- a/indra/newview/llscriptruntimeperms.h
+++ b/indra/newview/llscriptruntimeperms.h
@@ -27,6 +27,8 @@
#ifndef LL_LLSCRIPTRUNTIME_PERMS_H
#define LL_LLSCRIPTRUNTIME_PERMS_H
+#include <boost/array.hpp>
+
typedef struct _script_perm {
std::string question;
U32 permbit;
@@ -37,6 +39,8 @@ typedef struct _script_perm {
const U32 NUM_SCRIPT_PERMISSIONS = 16;
const S32 SCRIPT_PERMISSION_DEBIT = 0;
+const S32 SCRIPT_PERMISSION_TRIGGER_ANIMATION = 3;
+const S32 SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS = 14;
static const boost::array<script_perm_t, NUM_SCRIPT_PERMISSIONS> SCRIPT_PERMISSIONS = {{
_script_perm("ScriptTakeMoney", (0x1 << 1), true),