Change Bird prims to temporary as well as phantom to stop them persisting in the database
parent
51cb61fb29
commit
173e046aba
|
@ -48,9 +48,11 @@ namespace Flocking
|
|||
public int Size {
|
||||
get {return m_flock.Count;}
|
||||
set {
|
||||
if( value < m_flock.Count ) {
|
||||
m_flock.RemoveRange( 0, m_flock.Count - value );
|
||||
} else while( value > m_flock.Count ) {
|
||||
//if( value < m_flock.Count ) {
|
||||
// m_flock.RemoveRange( 0, m_flock.Count - value );
|
||||
//} else
|
||||
m_flock = new List<Bird>();
|
||||
while( value > m_flock.Count ) {
|
||||
AddBird(m_name + m_flock.Count);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,8 +145,8 @@ namespace Flocking
|
|||
|
||||
public void RegionLoaded (Scene scene)
|
||||
{
|
||||
//m_scene = scene;
|
||||
if (m_enabled) {
|
||||
if (m_enabled)
|
||||
{
|
||||
// Mark Module Ready for duty
|
||||
m_ready = true;
|
||||
}
|
||||
|
@ -355,9 +355,10 @@ namespace Flocking
|
|||
lock( m_sync ) {
|
||||
int newSize = Convert.ToInt32(args[1]);
|
||||
if (newSize > m_maxFlockSize) newSize = m_maxFlockSize;
|
||||
m_model.Size = newSize;
|
||||
m_view.Clear();
|
||||
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_view.Clear();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace Flocking
|
|||
m_scene.ForceClientUpdate();
|
||||
}
|
||||
|
||||
public void Render (List<Bird> birds)
|
||||
public void Render(List<Bird> birds)
|
||||
{
|
||||
foreach (Bird bird in birds) {
|
||||
DrawBird (bird);
|
||||
|
@ -93,7 +93,7 @@ namespace Flocking
|
|||
sog = CopyPrim (group, bird.Id);
|
||||
rootPart = sog.RootPart;
|
||||
//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_scene.AddNewSceneObject (sog, false);
|
||||
// Fire script on_rez
|
||||
|
|
|
@ -182,9 +182,12 @@ namespace Flocking
|
|||
|
||||
public bool IsWithinObstacle( int x, int y, int z ) {
|
||||
bool retVal = false;
|
||||
if( x >= LengthX || y >= LengthY || z >= LengthZ ) {
|
||||
if (x >= LengthX || y >= LengthY || z >= LengthZ)
|
||||
{
|
||||
retVal = true;
|
||||
} else if( x < 0 || y < 0 || z < 0 ) {
|
||||
}
|
||||
else if (x < 0 || y < 0 || z < 0)
|
||||
{
|
||||
retVal = true;
|
||||
} else if (m_flowMap[x,y,z] > 50f) {
|
||||
retVal = true;
|
||||
|
|
Loading…
Reference in New Issue