diff options
author | onefang | 2019-09-11 16:36:50 +1000 |
---|---|---|
committer | onefang | 2019-09-11 16:36:50 +1000 |
commit | 50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch) | |
tree | 52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |
parent | Renamed branch to SledjChisl. (diff) | |
parent | Bump to release flavour, build 0. (diff) | |
download | opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2 opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz |
Merge branch 'SledjChisl'
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 095c57b..03e2c5a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -42,11 +42,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
42 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")] | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")] |
44 | public class GesturesModule : INonSharedRegionModule | 44 | public class GesturesModule : INonSharedRegionModule |
45 | { | 45 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | protected Scene m_scene; | 48 | protected Scene m_scene; |
49 | 49 | ||
50 | public void Initialise(IConfigSource source) | 50 | public void Initialise(IConfigSource source) |
51 | { | 51 | { |
52 | } | 52 | } |
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
67 | m_scene.EventManager.OnNewClient -= OnNewClient; | 67 | m_scene.EventManager.OnNewClient -= OnNewClient; |
68 | m_scene = null; | 68 | m_scene = null; |
69 | } | 69 | } |
70 | 70 | ||
71 | public void Close() {} | 71 | public void Close() {} |
72 | public string Name { get { return "Gestures Module"; } } | 72 | public string Name { get { return "Gestures Module"; } } |
73 | 73 | ||
@@ -81,19 +81,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
81 | client.OnActivateGesture += ActivateGesture; | 81 | client.OnActivateGesture += ActivateGesture; |
82 | client.OnDeactivateGesture += DeactivateGesture; | 82 | client.OnDeactivateGesture += DeactivateGesture; |
83 | } | 83 | } |
84 | 84 | ||
85 | public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) | 85 | public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) |
86 | { | 86 | { |
87 | IInventoryService invService = m_scene.InventoryService; | 87 | IInventoryService invService = m_scene.InventoryService; |
88 | 88 | ||
89 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); | 89 | InventoryItemBase item = invService.GetItem(client.AgentId, gestureId); |
90 | item = invService.GetItem(item); | ||
91 | if (item != null) | 90 | if (item != null) |
92 | { | 91 | { |
93 | item.Flags |= 1; | 92 | item.Flags |= 1; |
94 | invService.UpdateItem(item); | 93 | invService.UpdateItem(item); |
95 | } | 94 | } |
96 | else | 95 | else |
97 | m_log.WarnFormat( | 96 | m_log.WarnFormat( |
98 | "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); | 97 | "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); |
99 | } | 98 | } |
@@ -102,14 +101,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
102 | { | 101 | { |
103 | IInventoryService invService = m_scene.InventoryService; | 102 | IInventoryService invService = m_scene.InventoryService; |
104 | 103 | ||
105 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); | 104 | InventoryItemBase item = invService.GetItem(client.AgentId, gestureId); |
106 | item = invService.GetItem(item); | ||
107 | if (item != null) | 105 | if (item != null) |
108 | { | 106 | { |
109 | item.Flags &= ~(uint)1; | 107 | item.Flags &= ~(uint)1; |
110 | invService.UpdateItem(item); | 108 | invService.UpdateItem(item); |
111 | } | 109 | } |
112 | else | 110 | else |
113 | m_log.ErrorFormat( | 111 | m_log.ErrorFormat( |
114 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); | 112 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); |
115 | } | 113 | } |