mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9330] Fixed msvc compile warnings.
This commit is contained in:
parent
a167fd98d2
commit
696cba9c37
20 changed files with 142 additions and 144 deletions
|
|
@ -105,7 +105,7 @@ void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
|
||||||
|
|
||||||
bool BattleGroundBE::HandlePlayerUnderMap(Player *player)
|
bool BattleGroundBE::HandlePlayerUnderMap(Player *player)
|
||||||
{
|
{
|
||||||
player->TeleportTo(GetMapId(),6238.930176,262.963470,0.889519,player->GetOrientation(),false);
|
player->TeleportTo(GetMapId(),6238.930176f,262.963470f,0.889519f,player->GetOrientation(),false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
|
||||||
|
|
||||||
bool BattleGroundNA::HandlePlayerUnderMap(Player *player)
|
bool BattleGroundNA::HandlePlayerUnderMap(Player *player)
|
||||||
{
|
{
|
||||||
player->TeleportTo(GetMapId(),4055.504395,2919.660645,13.611241,player->GetOrientation(),false);
|
player->TeleportTo(GetMapId(),4055.504395f,2919.660645f,13.611241f,player->GetOrientation(),false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
|
||||||
|
|
||||||
bool BattleGroundRL::HandlePlayerUnderMap(Player *player)
|
bool BattleGroundRL::HandlePlayerUnderMap(Player *player)
|
||||||
{
|
{
|
||||||
player->TeleportTo(GetMapId(),1285.810547,1667.896851,39.957642,player->GetOrientation(),false);
|
player->TeleportTo(GetMapId(),1285.810547f,1667.896851f,39.957642f,player->GetOrientation(),false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -652,7 +652,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||||
break;
|
break;
|
||||||
case ACTION_T_RANGED_MOVEMENT:
|
case ACTION_T_RANGED_MOVEMENT:
|
||||||
AttackDistance = (float)action.ranged_movement.distance;
|
AttackDistance = (float)action.ranged_movement.distance;
|
||||||
AttackAngle = action.ranged_movement.angle/180.0f*M_PI;
|
AttackAngle = action.ranged_movement.angle/180.0f*M_PI_F;
|
||||||
|
|
||||||
if (CombatMovementEnabled)
|
if (CombatMovementEnabled)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -84,59 +84,59 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
|
||||||
distance /= 4;
|
distance /= 4;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
angle = i_cur_angle + M_PI/4.0f;
|
angle = i_cur_angle + M_PI_F/4.0f;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
angle = i_cur_angle - M_PI/4.0f;
|
angle = i_cur_angle - M_PI_F/4.0f;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
angle = i_cur_angle + M_PI/4.0f;
|
angle = i_cur_angle + M_PI_F/4.0f;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
angle = i_cur_angle - M_PI/4.0f;
|
angle = i_cur_angle - M_PI_F/4.0f;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
angle = i_cur_angle + M_PI/2.0f;
|
angle = i_cur_angle + M_PI_F/2.0f;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
angle = i_cur_angle - M_PI/2.0f;
|
angle = i_cur_angle - M_PI_F/2.0f;
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
angle = i_cur_angle + M_PI/2.0f;
|
angle = i_cur_angle + M_PI_F/2.0f;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
angle = i_cur_angle - M_PI/2.0f;
|
angle = i_cur_angle - M_PI_F/2.0f;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
angle = i_cur_angle + M_PI/4.0f;
|
angle = i_cur_angle + M_PI_F/4.0f;
|
||||||
distance /= 4;
|
distance /= 4;
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
angle = i_cur_angle - M_PI/4.0f;
|
angle = i_cur_angle - M_PI_F/4.0f;
|
||||||
distance /= 4;
|
distance /= 4;
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
angle = i_cur_angle + M_PI/2.0f;
|
angle = i_cur_angle + M_PI_F/2.0f;
|
||||||
distance /= 4;
|
distance /= 4;
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
angle = i_cur_angle - M_PI/2.0f;
|
angle = i_cur_angle - M_PI_F/2.0f;
|
||||||
distance /= 4;
|
distance /= 4;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
angle = i_cur_angle + M_PI*3/4.0f;
|
angle = i_cur_angle + M_PI_F*3/4.0f;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
angle = i_cur_angle - M_PI*3/4.0f;
|
angle = i_cur_angle - M_PI_F*3/4.0f;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
angle = i_cur_angle + M_PI;
|
angle = i_cur_angle + M_PI_F;
|
||||||
distance /= 2;
|
distance /= 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -166,8 +166,8 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
|
||||||
|
|
||||||
if( !(new_z - z) || distance / fabs(new_z - z) > 1.0f)
|
if( !(new_z - z) || distance / fabs(new_z - z) > 1.0f)
|
||||||
{
|
{
|
||||||
float new_z_left = _map->GetHeight(temp_x + 1.0f*cos(angle+M_PI/2),temp_y + 1.0f*sin(angle+M_PI/2),z,true);
|
float new_z_left = _map->GetHeight(temp_x + 1.0f*cos(angle+M_PI_F/2),temp_y + 1.0f*sin(angle+M_PI_F/2),z,true);
|
||||||
float new_z_right = _map->GetHeight(temp_x + 1.0f*cos(angle-M_PI/2),temp_y + 1.0f*sin(angle-M_PI/2),z,true);
|
float new_z_right = _map->GetHeight(temp_x + 1.0f*cos(angle-M_PI_F/2),temp_y + 1.0f*sin(angle-M_PI_F/2),z,true);
|
||||||
if(fabs(new_z_left - new_z) < 1.2f && fabs(new_z_right - new_z) < 1.2f)
|
if(fabs(new_z_left - new_z) < 1.2f && fabs(new_z_right - new_z) < 1.2f)
|
||||||
{
|
{
|
||||||
x = temp_x;
|
x = temp_x;
|
||||||
|
|
@ -232,13 +232,13 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cur_dist = cur_dist_xyz;
|
cur_dist = cur_dist_xyz;
|
||||||
angle_to_caster = owner.GetAngle(i_caster_x, i_caster_y) + M_PI;
|
angle_to_caster = owner.GetAngle(i_caster_x, i_caster_y) + M_PI_F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cur_dist = cur_dist_xyz;
|
cur_dist = cur_dist_xyz;
|
||||||
angle_to_caster = owner.GetAngle(i_caster_x, i_caster_y) + M_PI;
|
angle_to_caster = owner.GetAngle(i_caster_x, i_caster_y) + M_PI_F;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we too close may use 'path-finding' else just stop
|
// if we too close may use 'path-finding' else just stop
|
||||||
|
|
@ -249,23 +249,23 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner)
|
||||||
|
|
||||||
if(i_cur_angle == 0.0f && i_last_distance_from_caster == 0.0f) //just started, first time
|
if(i_cur_angle == 0.0f && i_last_distance_from_caster == 0.0f) //just started, first time
|
||||||
{
|
{
|
||||||
angle = rand_norm()*(1.0f - cur_dist/MIN_QUIET_DISTANCE) * M_PI/3 + rand_norm()*M_PI*2/3;
|
angle = rand_norm()*(1.0f - cur_dist/MIN_QUIET_DISTANCE) * M_PI_F/3 + rand_norm()*M_PI_F*2/3;
|
||||||
i_to_distance_from_caster = MIN_QUIET_DISTANCE;
|
i_to_distance_from_caster = MIN_QUIET_DISTANCE;
|
||||||
i_only_forward = true;
|
i_only_forward = true;
|
||||||
}
|
}
|
||||||
else if(cur_dist < MIN_QUIET_DISTANCE)
|
else if(cur_dist < MIN_QUIET_DISTANCE)
|
||||||
{
|
{
|
||||||
angle = M_PI/6 + rand_norm()*M_PI*2/3;
|
angle = M_PI_F/6 + rand_norm()*M_PI_F*2/3;
|
||||||
i_to_distance_from_caster = cur_dist*2/3 + rand_norm()*(MIN_QUIET_DISTANCE - cur_dist*2/3);
|
i_to_distance_from_caster = cur_dist*2/3 + rand_norm()*(MIN_QUIET_DISTANCE - cur_dist*2/3);
|
||||||
}
|
}
|
||||||
else if(cur_dist > MAX_QUIET_DISTANCE)
|
else if(cur_dist > MAX_QUIET_DISTANCE)
|
||||||
{
|
{
|
||||||
angle = rand_norm()*M_PI/3 + M_PI*2/3;
|
angle = rand_norm()*M_PI_F/3 + M_PI_F*2/3;
|
||||||
i_to_distance_from_caster = MIN_QUIET_DISTANCE + 2.5f + rand_norm()*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE - 2.5f);
|
i_to_distance_from_caster = MIN_QUIET_DISTANCE + 2.5f + rand_norm()*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE - 2.5f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angle = rand_norm()*M_PI;
|
angle = rand_norm()*M_PI_F;
|
||||||
i_to_distance_from_caster = MIN_QUIET_DISTANCE + 2.5f + rand_norm()*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE - 2.5f);
|
i_to_distance_from_caster = MIN_QUIET_DISTANCE + 2.5f + rand_norm()*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE - 2.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@ bool Group::AddMember(const uint64 &guid, const char* name)
|
||||||
uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
|
uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
|
||||||
{
|
{
|
||||||
// remove member and change leader (if need) only if strong more 2 members _before_ member remove
|
// remove member and change leader (if need) only if strong more 2 members _before_ member remove
|
||||||
if(GetMembersCount() > (isBGGroup() ? 1 : 2)) // in BG group case allow 1 members group
|
if(GetMembersCount() > uint32(isBGGroup() ? 1 : 2)) // in BG group case allow 1 members group
|
||||||
{
|
{
|
||||||
bool leaderChanged = _removeMember(guid);
|
bool leaderChanged = _removeMember(guid);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3873,7 +3873,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
||||||
|
|
||||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||||
|
|
||||||
if(event_id < 1 || event_id >=events.size())
|
if(event_id < 1 || event_id >=(int32)events.size())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_EVENT_NOT_EXIST);
|
SendSysMessage(LANG_EVENT_NOT_EXIST);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -3915,7 +3915,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
||||||
|
|
||||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
|
||||||
|
|
||||||
if(event_id < 1 || event_id >=events.size())
|
if(event_id < 1 || event_id >=(int32)events.size())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_EVENT_NOT_EXIST);
|
SendSysMessage(LANG_EVENT_NOT_EXIST);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
|
||||||
|
|
@ -2662,7 +2662,7 @@ bool ChatHandler::HandleLookupItemCommand(const char* args)
|
||||||
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
|
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
|
||||||
if (il)
|
if (il)
|
||||||
{
|
{
|
||||||
if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty())
|
if ((int32)il->Name.size() > loc_idx && !il->Name[loc_idx].empty())
|
||||||
{
|
{
|
||||||
std::string name = il->Name[loc_idx];
|
std::string name = il->Name[loc_idx];
|
||||||
|
|
||||||
|
|
@ -2967,7 +2967,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char* args)
|
||||||
QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
|
QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
|
||||||
if (il)
|
if (il)
|
||||||
{
|
{
|
||||||
if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty())
|
if ((int32)il->Title.size() > loc_idx && !il->Title[loc_idx].empty())
|
||||||
{
|
{
|
||||||
std::string title = il->Title[loc_idx];
|
std::string title = il->Title[loc_idx];
|
||||||
|
|
||||||
|
|
@ -3067,7 +3067,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char* args)
|
||||||
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
|
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
|
||||||
if (cl)
|
if (cl)
|
||||||
{
|
{
|
||||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ())
|
if ((int32)cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ())
|
||||||
{
|
{
|
||||||
std::string name = cl->Name[loc_idx];
|
std::string name = cl->Name[loc_idx];
|
||||||
|
|
||||||
|
|
@ -3132,7 +3132,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char* args)
|
||||||
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
|
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
|
||||||
if (gl)
|
if (gl)
|
||||||
{
|
{
|
||||||
if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty())
|
if ((int32)gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty())
|
||||||
{
|
{
|
||||||
std::string name = gl->Name[loc_idx];
|
std::string name = gl->Name[loc_idx];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1349,7 +1349,7 @@ float WorldObject::GetAngle( const float x, const float y ) const
|
||||||
float dy = y - GetPositionY();
|
float dy = y - GetPositionY();
|
||||||
|
|
||||||
float ang = atan2(dy, dx);
|
float ang = atan2(dy, dx);
|
||||||
ang = (ang >= 0) ? ang : 2 * M_PI + ang;
|
ang = (ang >= 0) ? ang : 2 * M_PI_F + ang;
|
||||||
return ang;
|
return ang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1362,19 +1362,19 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
|
||||||
float arc = arcangle;
|
float arc = arcangle;
|
||||||
|
|
||||||
// move arc to range 0.. 2*pi
|
// move arc to range 0.. 2*pi
|
||||||
while( arc >= 2.0f * M_PI )
|
while( arc >= 2.0f * M_PI_F )
|
||||||
arc -= 2.0f * M_PI;
|
arc -= 2.0f * M_PI_F;
|
||||||
while( arc < 0 )
|
while( arc < 0 )
|
||||||
arc += 2.0f * M_PI;
|
arc += 2.0f * M_PI_F;
|
||||||
|
|
||||||
float angle = GetAngle( obj );
|
float angle = GetAngle( obj );
|
||||||
angle -= m_orientation;
|
angle -= m_orientation;
|
||||||
|
|
||||||
// move angle to range -pi ... +pi
|
// move angle to range -pi ... +pi
|
||||||
while( angle > M_PI)
|
while( angle > M_PI_F)
|
||||||
angle -= 2.0f * M_PI;
|
angle -= 2.0f * M_PI_F;
|
||||||
while(angle < -M_PI)
|
while(angle < -M_PI_F)
|
||||||
angle += 2.0f * M_PI;
|
angle += 2.0f * M_PI_F;
|
||||||
|
|
||||||
float lborder = -1 * (arc/2.0f); // in range -pi..0
|
float lborder = -1 * (arc/2.0f); // in range -pi..0
|
||||||
float rborder = (arc/2.0f); // in range 0..pi
|
float rborder = (arc/2.0f); // in range 0..pi
|
||||||
|
|
@ -1388,7 +1388,7 @@ bool WorldObject::isInFrontInMap(WorldObject const* target, float distance, flo
|
||||||
|
|
||||||
bool WorldObject::isInBackInMap(WorldObject const* target, float distance, float arc) const
|
bool WorldObject::isInBackInMap(WorldObject const* target, float distance, float arc) const
|
||||||
{
|
{
|
||||||
return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI - arc, target );
|
return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI_F - arc, target );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const
|
bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const
|
||||||
|
|
@ -1398,7 +1398,7 @@ bool WorldObject::isInFront(WorldObject const* target, float distance, float ar
|
||||||
|
|
||||||
bool WorldObject::isInBack(WorldObject const* target, float distance, float arc) const
|
bool WorldObject::isInBack(WorldObject const* target, float distance, float arc) const
|
||||||
{
|
{
|
||||||
return IsWithinDist(target, distance) && !HasInArc( 2 * M_PI - arc, target );
|
return IsWithinDist(target, distance) && !HasInArc( 2 * M_PI_F - arc, target );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
|
void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
|
||||||
|
|
@ -1412,7 +1412,7 @@ void WorldObject::GetRandomPoint( float x, float y, float z, float distance, flo
|
||||||
}
|
}
|
||||||
|
|
||||||
// angle to face `obj` to `this`
|
// angle to face `obj` to `this`
|
||||||
float angle = rand_norm()*2*M_PI;
|
float angle = rand_norm()*2*M_PI_F;
|
||||||
float new_dist = rand_norm()*distance;
|
float new_dist = rand_norm()*distance;
|
||||||
|
|
||||||
rand_x = x + new_dist * cos(angle);
|
rand_x = x + new_dist * cos(angle);
|
||||||
|
|
@ -1730,10 +1730,10 @@ namespace MaNGOS
|
||||||
float angle = i_object.GetAngle(u)-i_angle;
|
float angle = i_object.GetAngle(u)-i_angle;
|
||||||
|
|
||||||
// move angle to range -pi ... +pi
|
// move angle to range -pi ... +pi
|
||||||
while( angle > M_PI)
|
while( angle > M_PI_F)
|
||||||
angle -= 2.0f * M_PI;
|
angle -= 2.0f * M_PI_F;
|
||||||
while(angle < -M_PI)
|
while(angle < -M_PI_F)
|
||||||
angle += 2.0f * M_PI;
|
angle += 2.0f * M_PI_F;
|
||||||
|
|
||||||
// dist include size of u
|
// dist include size of u
|
||||||
float dist2d = i_object.GetDistance2d(x,y);
|
float dist2d = i_object.GetDistance2d(x,y);
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ void ObjectMgr::LoadCreatureLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Name.size() <= idx)
|
if((int32)data.Name.size() <= idx)
|
||||||
data.Name.resize(idx+1);
|
data.Name.resize(idx+1);
|
||||||
|
|
||||||
data.Name[idx] = str;
|
data.Name[idx] = str;
|
||||||
|
|
@ -316,7 +316,7 @@ void ObjectMgr::LoadCreatureLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.SubName.size() <= idx)
|
if((int32)data.SubName.size() <= idx)
|
||||||
data.SubName.resize(idx+1);
|
data.SubName.resize(idx+1);
|
||||||
|
|
||||||
data.SubName[idx] = str;
|
data.SubName[idx] = str;
|
||||||
|
|
@ -373,7 +373,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.OptionText.size() <= idx)
|
if((int32)data.OptionText.size() <= idx)
|
||||||
data.OptionText.resize(idx+1);
|
data.OptionText.resize(idx+1);
|
||||||
|
|
||||||
data.OptionText[idx] = str;
|
data.OptionText[idx] = str;
|
||||||
|
|
@ -385,7 +385,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.BoxText.size() <= idx)
|
if((int32)data.BoxText.size() <= idx)
|
||||||
data.BoxText.resize(idx+1);
|
data.BoxText.resize(idx+1);
|
||||||
|
|
||||||
data.BoxText[idx] = str;
|
data.BoxText[idx] = str;
|
||||||
|
|
@ -437,7 +437,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.IconName.size() <= idx)
|
if((int32)data.IconName.size() <= idx)
|
||||||
data.IconName.resize(idx+1);
|
data.IconName.resize(idx+1);
|
||||||
|
|
||||||
data.IconName[idx] = str;
|
data.IconName[idx] = str;
|
||||||
|
|
@ -1616,7 +1616,7 @@ void ObjectMgr::LoadItemLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Name.size() <= idx)
|
if((int32)data.Name.size() <= idx)
|
||||||
data.Name.resize(idx+1);
|
data.Name.resize(idx+1);
|
||||||
|
|
||||||
data.Name[idx] = str;
|
data.Name[idx] = str;
|
||||||
|
|
@ -1629,7 +1629,7 @@ void ObjectMgr::LoadItemLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Description.size() <= idx)
|
if((int32)data.Description.size() <= idx)
|
||||||
data.Description.resize(idx+1);
|
data.Description.resize(idx+1);
|
||||||
|
|
||||||
data.Description[idx] = str;
|
data.Description[idx] = str;
|
||||||
|
|
@ -3251,7 +3251,7 @@ void ObjectMgr::LoadGroups()
|
||||||
|
|
||||||
uint32 leaderGuidLow = fields[0].GetUInt32();
|
uint32 leaderGuidLow = fields[0].GetUInt32();
|
||||||
uint32 mapId = fields[1].GetUInt32();
|
uint32 mapId = fields[1].GetUInt32();
|
||||||
uint32 diff = fields[4].GetUInt8();
|
Difficulty diff = (Difficulty)fields[4].GetUInt8();
|
||||||
|
|
||||||
if(!group || GUID_LOPART(group->GetLeaderGUID()) != leaderGuidLow)
|
if(!group || GUID_LOPART(group->GetLeaderGUID()) != leaderGuidLow)
|
||||||
{
|
{
|
||||||
|
|
@ -3277,7 +3277,7 @@ void ObjectMgr::LoadGroups()
|
||||||
if(diff >= (mapEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
|
if(diff >= (mapEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
|
sLog.outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
|
||||||
diff = 0; // default for both difficaly types
|
diff = REGULAR_DIFFICULTY; // default for both difficaly types
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
|
InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
|
||||||
|
|
@ -4006,7 +4006,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Title.size() <= idx)
|
if((int32)data.Title.size() <= idx)
|
||||||
data.Title.resize(idx+1);
|
data.Title.resize(idx+1);
|
||||||
|
|
||||||
data.Title[idx] = str;
|
data.Title[idx] = str;
|
||||||
|
|
@ -4018,7 +4018,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Details.size() <= idx)
|
if((int32)data.Details.size() <= idx)
|
||||||
data.Details.resize(idx+1);
|
data.Details.resize(idx+1);
|
||||||
|
|
||||||
data.Details[idx] = str;
|
data.Details[idx] = str;
|
||||||
|
|
@ -4030,7 +4030,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Objectives.size() <= idx)
|
if((int32)data.Objectives.size() <= idx)
|
||||||
data.Objectives.resize(idx+1);
|
data.Objectives.resize(idx+1);
|
||||||
|
|
||||||
data.Objectives[idx] = str;
|
data.Objectives[idx] = str;
|
||||||
|
|
@ -4042,7 +4042,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.OfferRewardText.size() <= idx)
|
if((int32)data.OfferRewardText.size() <= idx)
|
||||||
data.OfferRewardText.resize(idx+1);
|
data.OfferRewardText.resize(idx+1);
|
||||||
|
|
||||||
data.OfferRewardText[idx] = str;
|
data.OfferRewardText[idx] = str;
|
||||||
|
|
@ -4054,7 +4054,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.RequestItemsText.size() <= idx)
|
if((int32)data.RequestItemsText.size() <= idx)
|
||||||
data.RequestItemsText.resize(idx+1);
|
data.RequestItemsText.resize(idx+1);
|
||||||
|
|
||||||
data.RequestItemsText[idx] = str;
|
data.RequestItemsText[idx] = str;
|
||||||
|
|
@ -4066,7 +4066,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.EndText.size() <= idx)
|
if((int32)data.EndText.size() <= idx)
|
||||||
data.EndText.resize(idx+1);
|
data.EndText.resize(idx+1);
|
||||||
|
|
||||||
data.EndText[idx] = str;
|
data.EndText[idx] = str;
|
||||||
|
|
@ -4078,7 +4078,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.CompletedText.size() <= idx)
|
if((int32)data.CompletedText.size() <= idx)
|
||||||
data.CompletedText.resize(idx+1);
|
data.CompletedText.resize(idx+1);
|
||||||
|
|
||||||
data.CompletedText[idx] = str;
|
data.CompletedText[idx] = str;
|
||||||
|
|
@ -4092,7 +4092,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.ObjectiveText[k].size() <= idx)
|
if((int32)data.ObjectiveText[k].size() <= idx)
|
||||||
data.ObjectiveText[k].resize(idx+1);
|
data.ObjectiveText[k].resize(idx+1);
|
||||||
|
|
||||||
data.ObjectiveText[k][idx] = str;
|
data.ObjectiveText[k][idx] = str;
|
||||||
|
|
@ -4623,7 +4623,7 @@ void ObjectMgr::LoadPageTextLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Text.size() <= idx)
|
if((int32)data.Text.size() <= idx)
|
||||||
data.Text.resize(idx+1);
|
data.Text.resize(idx+1);
|
||||||
|
|
||||||
data.Text[idx] = str;
|
data.Text[idx] = str;
|
||||||
|
|
@ -4785,7 +4785,7 @@ void ObjectMgr::LoadNpcTextLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Text_0[j].size() <= idx)
|
if((int32)data.Text_0[j].size() <= idx)
|
||||||
data.Text_0[j].resize(idx+1);
|
data.Text_0[j].resize(idx+1);
|
||||||
|
|
||||||
data.Text_0[j][idx] = str0;
|
data.Text_0[j][idx] = str0;
|
||||||
|
|
@ -4797,7 +4797,7 @@ void ObjectMgr::LoadNpcTextLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Text_1[j].size() <= idx)
|
if((int32)data.Text_1[j].size() <= idx)
|
||||||
data.Text_1[j].resize(idx+1);
|
data.Text_1[j].resize(idx+1);
|
||||||
|
|
||||||
data.Text_1[j][idx] = str1;
|
data.Text_1[j][idx] = str1;
|
||||||
|
|
@ -5858,7 +5858,7 @@ void ObjectMgr::LoadGameObjectLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.Name.size() <= idx)
|
if((int32)data.Name.size() <= idx)
|
||||||
data.Name.resize(idx+1);
|
data.Name.resize(idx+1);
|
||||||
|
|
||||||
data.Name[idx] = str;
|
data.Name[idx] = str;
|
||||||
|
|
@ -5874,7 +5874,7 @@ void ObjectMgr::LoadGameObjectLocales()
|
||||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
if(data.CastBarCaption.size() <= idx)
|
if((int32)data.CastBarCaption.size() <= idx)
|
||||||
data.CastBarCaption.resize(idx+1);
|
data.CastBarCaption.resize(idx+1);
|
||||||
|
|
||||||
data.CastBarCaption[idx] = str;
|
data.CastBarCaption[idx] = str;
|
||||||
|
|
@ -7025,7 +7025,7 @@ int ObjectMgr::GetIndexForLocale( LocaleConstant loc )
|
||||||
|
|
||||||
LocaleConstant ObjectMgr::GetLocaleForIndex(int i)
|
LocaleConstant ObjectMgr::GetLocaleForIndex(int i)
|
||||||
{
|
{
|
||||||
if (i<0 || i>=m_LocalForIndex.size())
|
if (i<0 || i>=(int32)m_LocalForIndex.size())
|
||||||
return LOCALE_enUS;
|
return LOCALE_enUS;
|
||||||
|
|
||||||
return m_LocalForIndex[i];
|
return m_LocalForIndex[i];
|
||||||
|
|
@ -7198,7 +7198,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min
|
||||||
if (idx >= 0)
|
if (idx >= 0)
|
||||||
{
|
{
|
||||||
// 0 -> default, idx in to idx+1
|
// 0 -> default, idx in to idx+1
|
||||||
if (data.Content.size() <= idx+1)
|
if ((int32)data.Content.size() <= idx+1)
|
||||||
data.Content.resize(idx+2);
|
data.Content.resize(idx+2);
|
||||||
|
|
||||||
data.Content[idx+1] = str;
|
data.Content[idx+1] = str;
|
||||||
|
|
@ -7224,7 +7224,7 @@ const char *ObjectMgr::GetMangosString(int32 entry, int locale_idx) const
|
||||||
// Content[0] always exist if exist MangosStringLocale
|
// Content[0] always exist if exist MangosStringLocale
|
||||||
if(MangosStringLocale const *msl = GetMangosStringLocale(entry))
|
if(MangosStringLocale const *msl = GetMangosStringLocale(entry))
|
||||||
{
|
{
|
||||||
if(msl->Content.size() > locale_idx+1 && !msl->Content[locale_idx+1].empty())
|
if((int32)msl->Content.size() > locale_idx+1 && !msl->Content[locale_idx+1].empty())
|
||||||
return msl->Content[locale_idx+1].c_str();
|
return msl->Content[locale_idx+1].c_str();
|
||||||
else
|
else
|
||||||
return msl->Content[0].c_str();
|
return msl->Content[0].c_str();
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,8 @@ typedef std::vector<uint32> AutoSpellList;
|
||||||
|
|
||||||
#define ACTIVE_SPELLS_MAX 4
|
#define ACTIVE_SPELLS_MAX 4
|
||||||
|
|
||||||
#define PET_FOLLOW_DIST 1
|
#define PET_FOLLOW_DIST 1.0f
|
||||||
#define PET_FOLLOW_ANGLE (M_PI/2)
|
#define PET_FOLLOW_ANGLE M_PI_F/2
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||||
SpellCastTargets targets;
|
SpellCastTargets targets;
|
||||||
targets.setUnitTarget( target );
|
targets.setUnitTarget( target );
|
||||||
|
|
||||||
if (!m_creature->HasInArc(M_PI, target))
|
if (!m_creature->HasInArc(M_PI_F, target))
|
||||||
{
|
{
|
||||||
m_creature->SetInFront(target);
|
m_creature->SetInFront(target);
|
||||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
|
|
||||||
|
|
@ -1184,7 +1184,7 @@ void Player::Update( uint32 p_time )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//120 degrees of radiant range
|
//120 degrees of radiant range
|
||||||
else if( !HasInArc( 2*M_PI/3, pVictim ))
|
else if( !HasInArc( 2*M_PI_F/3, pVictim ))
|
||||||
{
|
{
|
||||||
setAttackTimer(BASE_ATTACK,100);
|
setAttackTimer(BASE_ATTACK,100);
|
||||||
if(m_swingErrorMsg != 2) // send single time (client auto repeat)
|
if(m_swingErrorMsg != 2) // send single time (client auto repeat)
|
||||||
|
|
@ -1215,7 +1215,7 @@ void Player::Update( uint32 p_time )
|
||||||
{
|
{
|
||||||
setAttackTimer(OFF_ATTACK,100);
|
setAttackTimer(OFF_ATTACK,100);
|
||||||
}
|
}
|
||||||
else if( !HasInArc( 2*M_PI/3, pVictim ))
|
else if( !HasInArc( 2*M_PI_F/3, pVictim ))
|
||||||
{
|
{
|
||||||
setAttackTimer(OFF_ATTACK,100);
|
setAttackTimer(OFF_ATTACK,100);
|
||||||
}
|
}
|
||||||
|
|
@ -1961,7 +1961,7 @@ void Player::RewardRage( uint32 damage, uint32 weaponSpeedHitFactor, bool attack
|
||||||
|
|
||||||
// Berserker Rage effect
|
// Berserker Rage effect
|
||||||
if(HasAura(18499,0))
|
if(HasAura(18499,0))
|
||||||
addRage *= 1.3;
|
addRage *= 1.3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
addRage *= sWorld.getRate(RATE_POWER_RAGE_INCOME);
|
addRage *= sWorld.getRate(RATE_POWER_RAGE_INCOME);
|
||||||
|
|
@ -6067,12 +6067,12 @@ void Player::UpdateArenaFields(void)
|
||||||
void Player::UpdateHonorFields()
|
void Player::UpdateHonorFields()
|
||||||
{
|
{
|
||||||
/// called when rewarding honor and at each save
|
/// called when rewarding honor and at each save
|
||||||
uint64 now = time(NULL);
|
time_t now = time(NULL);
|
||||||
uint64 today = uint64(time(NULL) / DAY) * DAY;
|
time_t today = (time(NULL) / DAY) * DAY;
|
||||||
|
|
||||||
if(m_lastHonorUpdateTime < today)
|
if(m_lastHonorUpdateTime < today)
|
||||||
{
|
{
|
||||||
uint64 yesterday = today - DAY;
|
time_t yesterday = today - DAY;
|
||||||
|
|
||||||
uint16 kills_today = PAIR32_LOPART(GetUInt32Value(PLAYER_FIELD_KILLS));
|
uint16 kills_today = PAIR32_LOPART(GetUInt32Value(PLAYER_FIELD_KILLS));
|
||||||
|
|
||||||
|
|
@ -12737,7 +12737,7 @@ void Player::SendPreparedQuest(uint64 guid)
|
||||||
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid);
|
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid);
|
||||||
if (nl)
|
if (nl)
|
||||||
{
|
{
|
||||||
if (nl->Text_0[0].size() > loc_idx && !nl->Text_0[0][loc_idx].empty())
|
if ((int32)nl->Text_0[0].size() > loc_idx && !nl->Text_0[0][loc_idx].empty())
|
||||||
title = nl->Text_0[0][loc_idx];
|
title = nl->Text_0[0][loc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12752,7 +12752,7 @@ void Player::SendPreparedQuest(uint64 guid)
|
||||||
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid);
|
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid);
|
||||||
if (nl)
|
if (nl)
|
||||||
{
|
{
|
||||||
if (nl->Text_1[0].size() > loc_idx && !nl->Text_1[0][loc_idx].empty())
|
if ((int32)nl->Text_1[0].size() > loc_idx && !nl->Text_1[0][loc_idx].empty())
|
||||||
title = nl->Text_1[0][loc_idx];
|
title = nl->Text_1[0][loc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14225,7 +14225,7 @@ bool Player::HasQuestForItem( uint32 itemid ) const
|
||||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
|
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
|
||||||
|
|
||||||
// 'unique' item
|
// 'unique' item
|
||||||
if (pProto->MaxCount && GetItemCount(itemid,true) < pProto->MaxCount)
|
if (pProto->MaxCount && (int32)GetItemCount(itemid,true) < pProto->MaxCount)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// allows custom amount drop when not 0
|
// allows custom amount drop when not 0
|
||||||
|
|
@ -14233,7 +14233,7 @@ bool Player::HasQuestForItem( uint32 itemid ) const
|
||||||
{
|
{
|
||||||
if (GetItemCount(itemid,true) < qinfo->ReqSourceCount[j])
|
if (GetItemCount(itemid,true) < qinfo->ReqSourceCount[j])
|
||||||
return true;
|
return true;
|
||||||
} else if (GetItemCount(itemid,true) < pProto->Stackable)
|
} else if ((int32)GetItemCount(itemid,true) < pProto->Stackable)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14323,7 +14323,7 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver)
|
||||||
{
|
{
|
||||||
if (const QuestLocale* pLocale = sObjectMgr.GetQuestLocale(pQuest->GetQuestId()))
|
if (const QuestLocale* pLocale = sObjectMgr.GetQuestLocale(pQuest->GetQuestId()))
|
||||||
{
|
{
|
||||||
if (pLocale->Title.size() > loc_idx && !pLocale->Title[loc_idx].empty())
|
if ((int32)pLocale->Title.size() > loc_idx && !pLocale->Title[loc_idx].empty())
|
||||||
strTitle = pLocale->Title[loc_idx];
|
strTitle = pLocale->Title[loc_idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14878,9 +14878,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
|
|
||||||
m_rest_bonus = fields[22].GetFloat();
|
m_rest_bonus = fields[22].GetFloat();
|
||||||
//speed collect rest bonus in offline, in logout, far from tavern, city (section/in hour)
|
//speed collect rest bonus in offline, in logout, far from tavern, city (section/in hour)
|
||||||
float bubble0 = 0.031;
|
float bubble0 = 0.031f;
|
||||||
//speed collect rest bonus in offline, in logout, in tavern, city (section/in hour)
|
//speed collect rest bonus in offline, in logout, in tavern, city (section/in hour)
|
||||||
float bubble1 = 0.125;
|
float bubble1 = 0.125f;
|
||||||
|
|
||||||
if(time_diff > 0)
|
if(time_diff > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -20825,7 +20825,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
|
||||||
}
|
}
|
||||||
|
|
||||||
// we already have same or higher talent rank learned
|
// we already have same or higher talent rank learned
|
||||||
if(curtalent_maxrank >= (talentRank + 1))
|
if(curtalent_maxrank >= int32(talentRank + 1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// check if we have enough talent points
|
// check if we have enough talent points
|
||||||
|
|
|
||||||
|
|
@ -2114,9 +2114,9 @@ void Spell::SetTargetMap(uint32 effIndex, uint32 targetMode, UnitList& targetUni
|
||||||
switch(targetMode)
|
switch(targetMode)
|
||||||
{
|
{
|
||||||
case TARGET_INFRONT_OF_VICTIM: break;
|
case TARGET_INFRONT_OF_VICTIM: break;
|
||||||
case TARGET_BEHIND_VICTIM: angle = M_PI; break;
|
case TARGET_BEHIND_VICTIM: angle = M_PI_F; break;
|
||||||
case TARGET_RIGHT_FROM_VICTIM: angle = -M_PI / 2; break;
|
case TARGET_RIGHT_FROM_VICTIM: angle = -M_PI_F / 2; break;
|
||||||
case TARGET_LEFT_FROM_VICTIM: angle = M_PI / 2; break;
|
case TARGET_LEFT_FROM_VICTIM: angle = M_PI_F / 2; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float _target_x, _target_y, _target_z;
|
float _target_x, _target_y, _target_z;
|
||||||
|
|
@ -2146,9 +2146,9 @@ void Spell::SetTargetMap(uint32 effIndex, uint32 targetMode, UnitList& targetUni
|
||||||
switch(targetMode)
|
switch(targetMode)
|
||||||
{
|
{
|
||||||
case TARGET_DYNAMIC_OBJECT_FRONT: break;
|
case TARGET_DYNAMIC_OBJECT_FRONT: break;
|
||||||
case TARGET_DYNAMIC_OBJECT_BEHIND: angle += M_PI; break;
|
case TARGET_DYNAMIC_OBJECT_BEHIND: angle += M_PI_F; break;
|
||||||
case TARGET_DYNAMIC_OBJECT_LEFT_SIDE: angle += M_PI / 2; break;
|
case TARGET_DYNAMIC_OBJECT_LEFT_SIDE: angle += M_PI_F / 2; break;
|
||||||
case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: angle -= M_PI / 2; break;
|
case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: angle -= M_PI_F / 2; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
@ -2177,13 +2177,13 @@ void Spell::SetTargetMap(uint32 effIndex, uint32 targetMode, UnitList& targetUni
|
||||||
switch(targetMode)
|
switch(targetMode)
|
||||||
{
|
{
|
||||||
case TARGET_POINT_AT_NORTH: break;
|
case TARGET_POINT_AT_NORTH: break;
|
||||||
case TARGET_POINT_AT_SOUTH: angle += M_PI; break;
|
case TARGET_POINT_AT_SOUTH: angle += M_PI_F; break;
|
||||||
case TARGET_POINT_AT_EAST: angle -= M_PI / 2; break;
|
case TARGET_POINT_AT_EAST: angle -= M_PI_F / 2; break;
|
||||||
case TARGET_POINT_AT_WEST: angle += M_PI / 2; break;
|
case TARGET_POINT_AT_WEST: angle += M_PI_F / 2; break;
|
||||||
case TARGET_POINT_AT_NE: angle -= M_PI / 4; break;
|
case TARGET_POINT_AT_NE: angle -= M_PI_F / 4; break;
|
||||||
case TARGET_POINT_AT_NW: angle += M_PI / 4; break;
|
case TARGET_POINT_AT_NW: angle += M_PI_F / 4; break;
|
||||||
case TARGET_POINT_AT_SE: angle -= 3*M_PI / 4; break;
|
case TARGET_POINT_AT_SE: angle -= 3*M_PI_F / 4; break;
|
||||||
case TARGET_POINT_AT_SW: angle += 3*M_PI / 4; break;
|
case TARGET_POINT_AT_SW: angle += 3*M_PI_F / 4; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
@ -4211,7 +4211,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
return SPELL_FAILED_TARGET_AURASTATE;
|
return SPELL_FAILED_TARGET_AURASTATE;
|
||||||
|
|
||||||
//Must be behind the target.
|
//Must be behind the target.
|
||||||
if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI, m_caster) )
|
if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI_F, m_caster) )
|
||||||
{
|
{
|
||||||
//Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
|
//Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
|
||||||
//Exclusion for Mutilate:Facing Limitation was removed in 2.0.1 and 3.0.3, but they still use the same, old Ex-Flags
|
//Exclusion for Mutilate:Facing Limitation was removed in 2.0.1 and 3.0.3, but they still use the same, old Ex-Flags
|
||||||
|
|
@ -4224,7 +4224,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Target must be facing you.
|
//Target must be facing you.
|
||||||
if((m_spellInfo->Attributes == 0x150010) && !target->HasInArc(M_PI, m_caster) )
|
if((m_spellInfo->Attributes == 0x150010) && !target->HasInArc(M_PI_F, m_caster) )
|
||||||
{
|
{
|
||||||
SendInterrupted(2);
|
SendInterrupted(2);
|
||||||
return SPELL_FAILED_NOT_INFRONT;
|
return SPELL_FAILED_NOT_INFRONT;
|
||||||
|
|
@ -4479,7 +4479,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
{
|
{
|
||||||
// spell different for friends and enemies
|
// spell different for friends and enemies
|
||||||
// hart version required facing
|
// hart version required facing
|
||||||
if(m_targets.getUnitTarget() && !m_caster->IsFriendlyTo(m_targets.getUnitTarget()) && !m_caster->HasInArc( M_PI, m_targets.getUnitTarget() ))
|
if(m_targets.getUnitTarget() && !m_caster->IsFriendlyTo(m_targets.getUnitTarget()) && !m_caster->HasInArc( M_PI_F, m_targets.getUnitTarget() ))
|
||||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -5247,7 +5247,7 @@ SpellCastResult Spell::CheckRange(bool strict)
|
||||||
if(min_range && dist < min_range)
|
if(min_range && dist < min_range)
|
||||||
return SPELL_FAILED_TOO_CLOSE;
|
return SPELL_FAILED_TOO_CLOSE;
|
||||||
if( m_caster->GetTypeId() == TYPEID_PLAYER &&
|
if( m_caster->GetTypeId() == TYPEID_PLAYER &&
|
||||||
(m_spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT) && !m_caster->HasInArc( M_PI, target ) )
|
(m_spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT) && !m_caster->HasInArc( M_PI_F, target ) )
|
||||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -718,23 +718,23 @@ namespace MaNGOS
|
||||||
switch(i_push_type)
|
switch(i_push_type)
|
||||||
{
|
{
|
||||||
case PUSH_IN_FRONT:
|
case PUSH_IN_FRONT:
|
||||||
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, 2*M_PI/3 ))
|
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, 2*M_PI_F/3 ))
|
||||||
i_data->push_back(itr->getSource());
|
i_data->push_back(itr->getSource());
|
||||||
break;
|
break;
|
||||||
case PUSH_IN_FRONT_90:
|
case PUSH_IN_FRONT_90:
|
||||||
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, M_PI/2 ))
|
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, M_PI_F/2 ))
|
||||||
i_data->push_back(itr->getSource());
|
i_data->push_back(itr->getSource());
|
||||||
break;
|
break;
|
||||||
case PUSH_IN_FRONT_30:
|
case PUSH_IN_FRONT_30:
|
||||||
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, M_PI/6 ))
|
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, M_PI_F/6 ))
|
||||||
i_data->push_back(itr->getSource());
|
i_data->push_back(itr->getSource());
|
||||||
break;
|
break;
|
||||||
case PUSH_IN_FRONT_15:
|
case PUSH_IN_FRONT_15:
|
||||||
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, M_PI/12 ))
|
if(i_spell.GetCaster()->isInFront((Unit*)(itr->getSource()), i_radius, M_PI_F/12 ))
|
||||||
i_data->push_back(itr->getSource());
|
i_data->push_back(itr->getSource());
|
||||||
break;
|
break;
|
||||||
case PUSH_IN_BACK:
|
case PUSH_IN_BACK:
|
||||||
if(i_spell.GetCaster()->isInBack((Unit*)(itr->getSource()), i_radius, 2*M_PI/3 ))
|
if(i_spell.GetCaster()->isInBack((Unit*)(itr->getSource()), i_radius, 2*M_PI_F/3 ))
|
||||||
i_data->push_back(itr->getSource());
|
i_data->push_back(itr->getSource());
|
||||||
break;
|
break;
|
||||||
case PUSH_SELF_CENTER:
|
case PUSH_SELF_CENTER:
|
||||||
|
|
|
||||||
|
|
@ -1640,7 +1640,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||||
|
|
||||||
// If this is a creature and it attacks from behind it has a probability to daze it's victim
|
// If this is a creature and it attacks from behind it has a probability to daze it's victim
|
||||||
if( (damageInfo->hitOutCome==MELEE_HIT_CRIT || damageInfo->hitOutCome==MELEE_HIT_CRUSHING || damageInfo->hitOutCome==MELEE_HIT_NORMAL || damageInfo->hitOutCome==MELEE_HIT_GLANCING) &&
|
if( (damageInfo->hitOutCome==MELEE_HIT_CRIT || damageInfo->hitOutCome==MELEE_HIT_CRUSHING || damageInfo->hitOutCome==MELEE_HIT_NORMAL || damageInfo->hitOutCome==MELEE_HIT_GLANCING) &&
|
||||||
GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this) )
|
GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI_F, this) )
|
||||||
{
|
{
|
||||||
// -probability is between 0% and 40%
|
// -probability is between 0% and 40%
|
||||||
// 20% base chance
|
// 20% base chance
|
||||||
|
|
@ -2417,7 +2417,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||||
// Dodge chance
|
// Dodge chance
|
||||||
|
|
||||||
// only players can't dodge if attacker is behind
|
// only players can't dodge if attacker is behind
|
||||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this))
|
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI_F,this))
|
||||||
{
|
{
|
||||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||||
}
|
}
|
||||||
|
|
@ -2445,7 +2445,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||||
// parry & block chances
|
// parry & block chances
|
||||||
|
|
||||||
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
||||||
if (!pVictim->HasInArc(M_PI,this))
|
if (!pVictim->HasInArc(M_PI_F,this))
|
||||||
{
|
{
|
||||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind.");
|
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind.");
|
||||||
}
|
}
|
||||||
|
|
@ -2626,7 +2626,7 @@ void Unit::SendMeleeAttackStop(Unit* victim)
|
||||||
|
|
||||||
bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType)
|
bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType)
|
||||||
{
|
{
|
||||||
if (pVictim->HasInArc(M_PI,this))
|
if (pVictim->HasInArc(M_PI_F,this))
|
||||||
{
|
{
|
||||||
/* Currently not exist spells with ignore block
|
/* Currently not exist spells with ignore block
|
||||||
// Ignore combat result aura (parry/dodge check on prepare)
|
// Ignore combat result aura (parry/dodge check on prepare)
|
||||||
|
|
@ -2748,7 +2748,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
if (attType == RANGED_ATTACK)
|
if (attType == RANGED_ATTACK)
|
||||||
{
|
{
|
||||||
// only if in front
|
// only if in front
|
||||||
if (pVictim->HasInArc(M_PI,this))
|
if (pVictim->HasInArc(M_PI_F,this))
|
||||||
{
|
{
|
||||||
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
||||||
tmp+=deflect_chance;
|
tmp+=deflect_chance;
|
||||||
|
|
@ -2759,7 +2759,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for attack from behind
|
// Check for attack from behind
|
||||||
if (!pVictim->HasInArc(M_PI,this))
|
if (!pVictim->HasInArc(M_PI_F,this))
|
||||||
{
|
{
|
||||||
// Can`t dodge from behind in PvP (but its possible in PvE)
|
// Can`t dodge from behind in PvP (but its possible in PvE)
|
||||||
if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
|
@ -2900,7 +2900,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
return SPELL_MISS_MISS;
|
return SPELL_MISS_MISS;
|
||||||
|
|
||||||
// cast by caster in front of victim
|
// cast by caster in front of victim
|
||||||
if (pVictim->HasInArc(M_PI,this))
|
if (pVictim->HasInArc(M_PI_F,this))
|
||||||
{
|
{
|
||||||
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
||||||
tmp+=deflect_chance;
|
tmp+=deflect_chance;
|
||||||
|
|
@ -5403,7 +5403,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Aura *aur = GetAura(71905, 0);
|
Aura *aur = GetAura(71905, 0);
|
||||||
if (aur && aur->GetStackAmount() + 1 >= aur->GetSpellProto()->StackAmount)
|
if (aur && uint32(aur->GetStackAmount() + 1) >= aur->GetSpellProto()->StackAmount)
|
||||||
{
|
{
|
||||||
RemoveAurasDueToSpell(71905);
|
RemoveAurasDueToSpell(71905);
|
||||||
CastSpell(this, 71904, true); // Chaos Bane
|
CastSpell(this, 71904, true); // Chaos Bane
|
||||||
|
|
@ -5576,7 +5576,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
|
||||||
if (dummySpell->SpellFamilyFlags == UI64LIT(0x0000000800000000))
|
if (dummySpell->SpellFamilyFlags == UI64LIT(0x0000000800000000))
|
||||||
{
|
{
|
||||||
// check attack comes not from behind
|
// check attack comes not from behind
|
||||||
if (!HasInArc(M_PI, pVictim))
|
if (!HasInArc(M_PI_F, pVictim))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
triggered_spell_id = 22858;
|
triggered_spell_id = 22858;
|
||||||
|
|
@ -5636,7 +5636,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
|
||||||
{
|
{
|
||||||
Modifier* mod = triggeredByAura->GetModifier();
|
Modifier* mod = triggeredByAura->GetModifier();
|
||||||
// if damage is more than need or target die from damage deal finish spell
|
// if damage is more than need or target die from damage deal finish spell
|
||||||
if( mod->m_amount <= damage || (int32)GetHealth() <= damage )
|
if( mod->m_amount <= (int32)damage || GetHealth() <= damage )
|
||||||
{
|
{
|
||||||
// remember guid before aura delete
|
// remember guid before aura delete
|
||||||
uint64 casterGuid = triggeredByAura->GetCasterGUID();
|
uint64 casterGuid = triggeredByAura->GetCasterGUID();
|
||||||
|
|
@ -5658,7 +5658,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
|
||||||
{
|
{
|
||||||
Modifier* mod = triggeredByAura->GetModifier();
|
Modifier* mod = triggeredByAura->GetModifier();
|
||||||
// if damage is more than need deal finish spell
|
// if damage is more than need deal finish spell
|
||||||
if( mod->m_amount <= damage )
|
if( mod->m_amount <= (int32)damage )
|
||||||
{
|
{
|
||||||
// remember guid before aura delete
|
// remember guid before aura delete
|
||||||
uint64 casterGuid = triggeredByAura->GetCasterGUID();
|
uint64 casterGuid = triggeredByAura->GetCasterGUID();
|
||||||
|
|
@ -7298,7 +7298,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If target's health is not below equal certain value (35%) not proc
|
// If target's health is not below equal certain value (35%) not proc
|
||||||
if ((pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount)
|
if (int32(pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -7546,7 +7546,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
||||||
else if (auraSpellInfo->SpellIconID == 2013)
|
else if (auraSpellInfo->SpellIconID == 2013)
|
||||||
{
|
{
|
||||||
// Check health condition - should drop to less 30% (damage deal after this!)
|
// Check health condition - should drop to less 30% (damage deal after this!)
|
||||||
if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth()))
|
if (!(10*(int32(GetHealth() - damage)) < int32(3 * GetMaxHealth())))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(pVictim && pVictim->isAlive())
|
if(pVictim && pVictim->isAlive())
|
||||||
|
|
@ -10537,14 +10537,14 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// find invisibility level
|
// find invisibility level
|
||||||
uint32 invLevel = 0;
|
int32 invLevel = 0;
|
||||||
Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
|
Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
|
||||||
for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
|
for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
|
||||||
if(((*itr)->GetModifier()->m_miscvalue)==i && invLevel < (*itr)->GetModifier()->m_amount)
|
if(((*itr)->GetModifier()->m_miscvalue)==i && invLevel < (*itr)->GetModifier()->m_amount)
|
||||||
invLevel = (*itr)->GetModifier()->m_amount;
|
invLevel = (*itr)->GetModifier()->m_amount;
|
||||||
|
|
||||||
// find invisibility detect level
|
// find invisibility detect level
|
||||||
uint32 detectLevel = 0;
|
int32 detectLevel = 0;
|
||||||
Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
|
Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
|
||||||
for(Unit::AuraList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
|
for(Unit::AuraList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
|
||||||
if(((*itr)->GetModifier()->m_miscvalue)==i && detectLevel < (*itr)->GetModifier()->m_amount)
|
if(((*itr)->GetModifier()->m_miscvalue)==i && detectLevel < (*itr)->GetModifier()->m_amount)
|
||||||
|
|
@ -12909,21 +12909,21 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized)
|
||||||
|
|
||||||
Item *Weapon = ((Player*)this)->GetWeaponForAttack(attType, true, false);
|
Item *Weapon = ((Player*)this)->GetWeaponForAttack(attType, true, false);
|
||||||
if (!Weapon)
|
if (!Weapon)
|
||||||
return 2.4; // fist attack
|
return 2.4f; // fist attack
|
||||||
|
|
||||||
switch (Weapon->GetProto()->InventoryType)
|
switch (Weapon->GetProto()->InventoryType)
|
||||||
{
|
{
|
||||||
case INVTYPE_2HWEAPON:
|
case INVTYPE_2HWEAPON:
|
||||||
return 3.3;
|
return 3.3f;
|
||||||
case INVTYPE_RANGED:
|
case INVTYPE_RANGED:
|
||||||
case INVTYPE_RANGEDRIGHT:
|
case INVTYPE_RANGEDRIGHT:
|
||||||
case INVTYPE_THROWN:
|
case INVTYPE_THROWN:
|
||||||
return 2.8;
|
return 2.8f;
|
||||||
case INVTYPE_WEAPON:
|
case INVTYPE_WEAPON:
|
||||||
case INVTYPE_WEAPONMAINHAND:
|
case INVTYPE_WEAPONMAINHAND:
|
||||||
case INVTYPE_WEAPONOFFHAND:
|
case INVTYPE_WEAPONOFFHAND:
|
||||||
default:
|
default:
|
||||||
return Weapon->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7 : 2.4;
|
return Weapon->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7f : 2.4f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ int WorldSocket::handle_output (ACE_HANDLE)
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if (n < send_len) //now n > 0
|
else if (n < (ssize_t)send_len) //now n > 0
|
||||||
{
|
{
|
||||||
m_OutBuffer->rd_ptr (static_cast<size_t> (n));
|
m_OutBuffer->rd_ptr (static_cast<size_t> (n));
|
||||||
|
|
||||||
|
|
@ -400,7 +400,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
|
||||||
mblk->release();
|
mblk->release();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if (n < send_len) //now n > 0
|
else if (n < (ssize_t)send_len) //now n > 0
|
||||||
{
|
{
|
||||||
mblk->rd_ptr (static_cast<size_t> (n));
|
mblk->rd_ptr (static_cast<size_t> (n));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,14 +57,8 @@
|
||||||
#if COMPILER == COMPILER_MICROSOFT
|
#if COMPILER == COMPILER_MICROSOFT
|
||||||
# pragma warning(disable:4996) // 'function': was declared deprecated
|
# pragma warning(disable:4996) // 'function': was declared deprecated
|
||||||
#ifndef __SHOW_STUPID_WARNINGS__
|
#ifndef __SHOW_STUPID_WARNINGS__
|
||||||
# pragma warning(disable:4005) // 'identifier' : macro redefinition
|
|
||||||
# pragma warning(disable:4018) // 'expression' : signed/unsigned mismatch
|
|
||||||
# pragma warning(disable:4244) // 'argument' : conversion from 'type1' to 'type2', possible loss of data
|
# pragma warning(disable:4244) // 'argument' : conversion from 'type1' to 'type2', possible loss of data
|
||||||
# pragma warning(disable:4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data
|
|
||||||
# pragma warning(disable:4305) // 'identifier' : truncation from 'type1' to 'type2'
|
|
||||||
# pragma warning(disable:4311) // 'variable' : pointer truncation from 'type' to 'type'
|
|
||||||
# pragma warning(disable:4355) // 'this' : used in base member initializer list
|
# pragma warning(disable:4355) // 'this' : used in base member initializer list
|
||||||
# pragma warning(disable:4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning)
|
|
||||||
#endif // __SHOW_STUPID_WARNINGS__
|
#endif // __SHOW_STUPID_WARNINGS__
|
||||||
#endif // __GNUC__
|
#endif // __GNUC__
|
||||||
|
|
||||||
|
|
@ -220,4 +214,8 @@ inline char * mangos_strdup(const char * source)
|
||||||
# define M_PI 3.14159265358979323846
|
# define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef M_PI_F
|
||||||
|
# define M_PI_F float(M_PI)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "dotconfpp.h"
|
#include "dotconfpp.h"
|
||||||
|
#include <ace/OS_NS_stdlib.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# define PATH_MAX _MAX_PATH
|
# define PATH_MAX _MAX_PATH
|
||||||
# define strcasecmp stricmp
|
# define strcasecmp stricmp
|
||||||
# define realpath(path,resolved_path) _fullpath(resolved_path, path, _MAX_PATH)
|
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
#else
|
#else
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
|
@ -405,7 +405,7 @@ int DOTCONFDocument::setContent(const char* _fileName)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char realpathBuf[PATH_MAX];
|
char realpathBuf[PATH_MAX];
|
||||||
|
|
||||||
if (realpath(_fileName, realpathBuf) == NULL)
|
if (ACE_OS::realpath(_fileName, realpathBuf) == NULL)
|
||||||
{
|
{
|
||||||
error(0, NULL, "realpath (%s) failed: %s", _fileName, strerror(errno));
|
error(0, NULL, "realpath (%s) failed: %s", _fileName, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -453,7 +453,7 @@ int DOTCONFDocument::setContent(const char* _fileName)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (realpath(tagNode->values[vi], realpathBuf) == NULL)
|
if (ACE_OS::realpath(tagNode->values[vi], realpathBuf) == NULL)
|
||||||
{
|
{
|
||||||
error(tagNode->lineNum, tagNode->fileName, "realpath (%s) failed: %s", tagNode->values[vi], strerror(errno));
|
error(tagNode->lineNum, tagNode->fileName, "realpath (%s) failed: %s", tagNode->values[vi], strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9329"
|
#define REVISION_NR "9330"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue