Change Bird prims to temporary as well as phantom to stop them persisting in the database

pull/1/merge
Jak Daniels 2015-01-03 12:52:46 +00:00
parent 51cb61fb29
commit 173e046aba
4 changed files with 26 additions and 20 deletions

View File

@ -48,9 +48,11 @@ namespace Flocking
public int Size { public int Size {
get {return m_flock.Count;} get {return m_flock.Count;}
set { set {
if( value < m_flock.Count ) { //if( value < m_flock.Count ) {
m_flock.RemoveRange( 0, m_flock.Count - value ); // m_flock.RemoveRange( 0, m_flock.Count - value );
} else while( value > m_flock.Count ) { //} else
m_flock = new List<Bird>();
while( value > m_flock.Count ) {
AddBird(m_name + m_flock.Count); AddBird(m_name + m_flock.Count);
} }
} }

View File

@ -145,8 +145,8 @@ namespace Flocking
public void RegionLoaded (Scene scene) public void RegionLoaded (Scene scene)
{ {
//m_scene = scene; if (m_enabled)
if (m_enabled) { {
// Mark Module Ready for duty // Mark Module Ready for duty
m_ready = true; m_ready = true;
} }
@ -355,9 +355,10 @@ namespace Flocking
lock( m_sync ) { lock( m_sync ) {
int newSize = Convert.ToInt32(args[1]); int newSize = Convert.ToInt32(args[1]);
if (newSize > m_maxFlockSize) newSize = m_maxFlockSize; if (newSize > m_maxFlockSize) newSize = m_maxFlockSize;
m_view.Clear();
m_model.Size = newSize; m_model.Size = newSize;
m_log.InfoFormat("[{0}]: Bird flock size is set to {1} in region {2}.", m_name, newSize, m_scene.RegionInfo.RegionName); m_log.InfoFormat("[{0}]: Bird flock size is set to {1} in region {2}.", m_name, newSize, m_scene.RegionInfo.RegionName);
m_view.Clear();
} }
} }
} }

View File

@ -72,7 +72,7 @@ namespace Flocking
m_scene.ForceClientUpdate(); m_scene.ForceClientUpdate();
} }
public void Render (List<Bird> birds) public void Render(List<Bird> birds)
{ {
foreach (Bird bird in birds) { foreach (Bird bird in birds) {
DrawBird (bird); DrawBird (bird);
@ -93,7 +93,7 @@ namespace Flocking
sog = CopyPrim (group, bird.Id); sog = CopyPrim (group, bird.Id);
rootPart = sog.RootPart; rootPart = sog.RootPart;
//set prim to phantom //set prim to phantom
sog.UpdatePrimFlags(rootPart.LocalId, false, false, true, false); sog.UpdatePrimFlags(rootPart.LocalId, false, true, true, false);
m_sogMap [bird.Id] = sog; m_sogMap [bird.Id] = sog;
m_scene.AddNewSceneObject (sog, false); m_scene.AddNewSceneObject (sog, false);
// Fire script on_rez // Fire script on_rez

View File

@ -182,9 +182,12 @@ namespace Flocking
public bool IsWithinObstacle( int x, int y, int z ) { public bool IsWithinObstacle( int x, int y, int z ) {
bool retVal = false; bool retVal = false;
if( x >= LengthX || y >= LengthY || z >= LengthZ ) { if (x >= LengthX || y >= LengthY || z >= LengthZ)
{
retVal = true; retVal = true;
} else if( x < 0 || y < 0 || z < 0 ) { }
else if (x < 0 || y < 0 || z < 0)
{
retVal = true; retVal = true;
} else if (m_flowMap[x,y,z] > 50f) { } else if (m_flowMap[x,y,z] > 50f) {
retVal = true; retVal = true;