[svn] DynamicObject should only be visible for caster if it is not in distance. However, I do not think this will fix the bug that dynamic object update freezes the server.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-15 11:56:59 -06:00
parent 9ff33852b7
commit 8df6868fac
7 changed files with 56 additions and 53 deletions
+4 -2
View File
@@ -70,7 +70,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32
return false;
}
SetUInt32Value( OBJECT_FIELD_ENTRY, spellId );
SetEntry(spellId);
SetFloatValue( OBJECT_FIELD_SCALE_X, 1 );
SetUInt64Value( DYNAMICOBJECT_CASTER, caster->GetGUID() );
SetUInt32Value( DYNAMICOBJECT_BYTES, 0x00000001 );
@@ -153,5 +153,7 @@ void DynamicObject::Delay(int32 delaytime)
bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) const
{
return IsInWorld() && u->IsInWorld() /*&& IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f))*/;
return IsInWorld() && u->IsInWorld()
&& (IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f))
|| GetCasterGUID() == u->GetGUID());
}
-1
View File
@@ -612,7 +612,6 @@ ObjectAccessor::ActiveObjectsNearGrid(uint32 x, uint32 y, uint32 m_id, uint32 i_
if( (cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) &&
(cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord) )
return true;
}
return false;
+3
View File
@@ -330,6 +330,7 @@ void CliRunnable::run()
break;
}
if(!*command_str)
{
printf("TC>");
@@ -346,8 +347,10 @@ void CliRunnable::run()
sWorld.QueueCliCommand(&utf8print,command.c_str());
}
else if (feof(stdin))
{
World::m_stopEvent = true;
}
}
///- End the database thread
WorldDatabase.ThreadEnd(); // free mySQL thread resources
-1
View File
@@ -137,7 +137,6 @@ extern int main(int argc, char **argv)
sLog.outError("Could not find configuration file %s.", cfg_file);
return 1;
}
sLog.outString("Using configuration file %s.", cfg_file);
uint32 confVersion = sConfig.GetIntDefault("ConfVersion", 0);