From 8df6868fac60722f4b5c5278492a1e6bad19b10e Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 15 Nov 2008 11:56:59 -0600 Subject: [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 --- src/game/DynamicObject.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/game/DynamicObject.cpp') diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 854d2e82e3e..5a5ba008606 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -10,12 +10,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Common.h" @@ -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()); } -- cgit v1.2.3