diff options
author | Justin Clark-Casey (justincc) | 2012-07-09 21:24:32 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-09 21:24:32 +0100 |
commit | 2eaa6d5ace738cf1848f82ce7a0b435928b6846f (patch) | |
tree | 091add9a2885fbb702cf908e1b2f70f5d1730131 /OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |
parent | More keys for automated ini processing (diff) | |
download | opensim-SC_OLD-2eaa6d5ace738cf1848f82ce7a0b435928b6846f.zip opensim-SC_OLD-2eaa6d5ace738cf1848f82ce7a0b435928b6846f.tar.gz opensim-SC_OLD-2eaa6d5ace738cf1848f82ce7a0b435928b6846f.tar.bz2 opensim-SC_OLD-2eaa6d5ace738cf1848f82ce7a0b435928b6846f.tar.xz |
Do not allow a script to attach a prim if its being sat upon.
This prevents a stack overflow where a get position on the avatar will refer to the attachment which will in turn refer back to the avatar.
This required recording of all sitting avatars on a prim which is done separately from recording the sit target avatar.
Recording HashSet is null if there are no sitting avatars in order to save memory.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 9eb0e38..eccf7a6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -251,6 +251,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
251 | // m_log.DebugFormat( | 251 | // m_log.DebugFormat( |
252 | // "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})", | 252 | // "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})", |
253 | // group.Name, group.LocalId, sp.Name, attachmentPt, silent); | 253 | // group.Name, group.LocalId, sp.Name, attachmentPt, silent); |
254 | |||
255 | if (group.GetSittingAvatarsCount() != 0) | ||
256 | { | ||
257 | // m_log.WarnFormat( | ||
258 | // "[ATTACHMENTS MODULE]: Ignoring request to attach {0} {1} to {2} on {3} since {4} avatars are still sitting on it", | ||
259 | // group.Name, group.LocalId, sp.Name, attachmentPt, group.GetSittingAvatarsCount()); | ||
260 | |||
261 | return false; | ||
262 | } | ||
254 | 263 | ||
255 | if (sp.GetAttachments(attachmentPt).Contains(group)) | 264 | if (sp.GetAttachments(attachmentPt).Contains(group)) |
256 | { | 265 | { |