From fc551ef1271ee01888a874277b963eb35ddadaef Mon Sep 17 00:00:00 2001
From: MW
Date: Wed, 12 Mar 2008 15:53:04 +0000
Subject: Applied patch from mantis #749, Grass now stays to set type when
moved. thanks Grumly57.
---
OpenSim/Framework/IClientAPI.cs | 2 +-
OpenSim/Region/ClientStack/ClientView.cs | 14 ++++++++------
OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 4 ++--
OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 2 +-
4 files changed, 12 insertions(+), 10 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 7a0a232..d30e005 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -608,7 +608,7 @@ namespace OpenSim.Framework
uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction);
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
- LLQuaternion rotation);
+ LLQuaternion rotation, byte state);
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity);
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index f11ac56..58d425d 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -1898,7 +1898,7 @@ namespace OpenSim.Region.ClientStack
///
///
public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
- LLQuaternion rotation)
+ LLQuaternion rotation, byte state)
{
LLVector3 velocity = new LLVector3(0f, 0f, 0f);
LLVector3 rotationalvelocity = new LLVector3(0f, 0f, 0f);
@@ -1907,7 +1907,7 @@ namespace OpenSim.Region.ClientStack
terse.RegionData.RegionHandle = regionHandle;
terse.RegionData.TimeDilation = timeDilation;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
- terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity);
+ terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity, state);
terse.Header.Reliable = false;
OutPacket(terse, ThrottleOutPacketType.Task);
}
@@ -1920,7 +1920,7 @@ namespace OpenSim.Region.ClientStack
terse.RegionData.RegionHandle = regionHandle;
terse.RegionData.TimeDilation = timeDilation;
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
- terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity);
+ terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity, 0);
terse.Header.Reliable = false;
OutPacket(terse, ThrottleOutPacketType.Task);
}
@@ -2027,7 +2027,8 @@ namespace OpenSim.Region.ClientStack
LLVector3 position,
LLQuaternion rotation,
LLVector3 velocity,
- LLVector3 rotationalvelocity)
+ LLVector3 rotationalvelocity,
+ byte state)
{
uint ID = localID;
byte[] bytes = new byte[60];
@@ -2039,7 +2040,7 @@ namespace OpenSim.Region.ClientStack
bytes[i++] = (byte)((ID >> 8) % 256);
bytes[i++] = (byte)((ID >> 16) % 256);
bytes[i++] = (byte)((ID >> 24) % 256);
- bytes[i++] = 0;
+ bytes[i++] = state;
bytes[i++] = 0;
byte[] pb = position.GetBytes();
@@ -2125,7 +2126,8 @@ namespace OpenSim.Region.ClientStack
SetDefaultPrimPacketValues(objupdate);
objupdate.UpdateFlags = flags;
SetPrimPacketShapeData(objupdate, primShape);
- if ((primShape.PCode == 111) || (primShape.PCode == 255))
+ // if ((primShape.PCode == 111) || (primShape.PCode == 255))
+ if ((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass))
{
objupdate.Data = new byte[1];
objupdate.Data[0] = primShape.State;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 6ed63be..f20a638 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1814,7 +1814,7 @@ namespace OpenSim.Region.Environment.Scenes
LLQuaternion mRot = RotationOffset;
if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
{
- remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot);
+ remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Shape.State);
}
else
{
@@ -1829,7 +1829,7 @@ namespace OpenSim.Region.Environment.Scenes
LLQuaternion mRot = RotationOffset;
if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
{
- remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot);
+ remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Shape.State);
}
else
{
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 68fea97..82ff3cc 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -357,7 +357,7 @@ namespace SimpleApp
{
}
public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID,
- LLVector3 position, LLQuaternion rotation)
+ LLVector3 position, LLQuaternion rotation, byte state)
{
}
--
cgit v1.1