From 7d1dcf3e68372a0692615c19ade95365ed633fcf Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 17 Mar 2008 17:23:49 +0000 Subject: Replaced some magic PCode numbers with enum values. --- OpenSim/Framework/PrimitiveBaseShape.cs | 6 +++++- OpenSim/Region/ClientStack/ClientView.cs | 4 ++-- OpenSim/Region/Environment/Scenes/InnerScene.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 856f819..d0af5a8 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -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 diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index d53201f..15540ea 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -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; diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 5d99f22..3e5610c 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -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; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 19dbbc9..9466ab9 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -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; -- cgit v1.1