Replaced some magic PCode numbers with enum values.

0.6.0-stable
Jeff Ames 2008-03-17 17:23:49 +00:00
parent 825c89e7ac
commit 7d1dcf3e68
4 changed files with 9 additions and 5 deletions

View File

@ -53,7 +53,11 @@ namespace OpenSim.Framework
public enum PCodeEnum : byte
{
Primitive = 9,
Avatar = 47
Avatar = 47,
Grass = 95,
NewTree = 111,
ParticleSystem = 143,
Tree = 255
}
public enum Extrusion : byte

View File

@ -2126,7 +2126,7 @@ namespace OpenSim.Region.ClientStack
SetDefaultPrimPacketValues(objupdate);
objupdate.UpdateFlags = flags;
SetPrimPacketShapeData(objupdate, primShape);
// 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];
@ -2206,7 +2206,7 @@ namespace OpenSim.Region.ClientStack
objdata.ParentID = 0;
objdata.OwnerID = LLUUID.Zero;
objdata.Scale = new LLVector3(1, 1, 1);
objdata.PCode = 47;
objdata.PCode = (byte)PCode.Avatar;
if (textureEntry != null)
{
objdata.TextureEntry = textureEntry;

View File

@ -335,7 +335,7 @@ namespace OpenSim.Region.Environment.Scenes
objupdate.ObjectData[0].ParentID = 0;
objupdate.ObjectData[0].OwnerID = LLUUID.Zero;
objupdate.ObjectData[0].Scale = new LLVector3(1, 1, 1);
objupdate.ObjectData[0].PCode = 47;
objupdate.ObjectData[0].PCode = (byte)PCode.Avatar;
objupdate.ObjectData[0].TextureEntry = ScenePresence.DefaultTexture;
objupdate.ObjectData[0].ID = av.LocalId;

View File

@ -1121,7 +1121,7 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
// if grass or tree, make phantom
//rootPart.TrimPermissions();
if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
if ((rootPart.Shape.PCode == (byte)PCode.Grass) || (rootPart.Shape.PCode == (byte)PCode.Tree) || (rootPart.Shape.PCode == (byte)PCode.NewTree))
{
rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
//rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;