Merge branch 'master' into 310

Conflicts:
	src/game/Chat.cpp
	src/game/Chat.h
	src/game/GameObject.cpp
	src/game/Level2.cpp
This commit is contained in:
tomrus88 2009-03-21 15:48:51 +03:00
commit e5bde711ea
31 changed files with 1295 additions and 1109 deletions

View file

@ -98,7 +98,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
if(!IsPositionValid())
{
sLog.outError("ERROR: Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
sLog.outError("Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
return false;
}
@ -557,7 +557,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
if( !data )
{
sLog.outErrorDb("ERROR: Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
sLog.outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
return false;
}
@ -1300,11 +1300,13 @@ const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
void GameObject::UpdateRotationFields(float rotation2 /*=0.0f*/, float rotation3 /*=0.0f*/)
{
int64 rotation = 0;
static double const atan_pow = atan(pow(2.0f, -20.0f));
double f_rot1 = sin(GetOrientation() / 2.0f);
int64 i_rot1 = int64(f_rot1 / atan(pow(2.0f, -20.0f)));
rotation |= (i_rot1 << 43 >> 43) & 0x00000000001FFFFF;
double f_rot2 = cos(GetOrientation() / 2.0f);
int64 i_rot1 = int64(f_rot1 / atan_pow *(f_rot2 >= 0 ? 1.0f : -1.0f));
int64 rotation = (i_rot1 << 43 >> 43) & 0x00000000001FFFFF;
//float f_rot2 = sin(0.0f / 2.0f);
//int64 i_rot2 = f_rot2 / atan(pow(2.0f, -20.0f));
@ -1318,8 +1320,8 @@ void GameObject::UpdateRotationFields(float rotation2 /*=0.0f*/, float rotation3
if(rotation2==0.0f && rotation3==0.0f)
{
rotation2 = sin(GetOrientation()/2);
rotation3 = cos(GetOrientation()/2);
rotation2 = f_rot1;
rotation3 = f_rot2;
}
SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation2);