Various external fixes - part 7
Ported commits from cmangos repositories - https://github.com/cmangos/mangos-classic/commit/10a1710 - https://github.com/cmangos/mangos-classic/commit/4aacdaf - https://github.com/cmangos/mangos-classic/commit/c05d0ed - https://github.com/cmangos/mangos-classic/commit/e8aa9cb
This commit is contained in:
parent
83456f318c
commit
991cbf6350
@ -66,7 +66,11 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE;
|
||||
#else // PLATFORM != PLATFORM_WINDOWS
|
||||
# define MANGOS_EXPORT export
|
||||
# if defined(__APPLE_CC__) && defined(BIG_ENDIAN)
|
||||
# define MANGOS_IMPORT __attribute__ ((longcall))
|
||||
# if (defined(__ppc__) || defined(__powerpc__))
|
||||
# define MANGOS_IMPORT __attribute__ ((longcall))
|
||||
# else
|
||||
# define MANGOS_IMPORT
|
||||
# endif
|
||||
# elif defined(__x86_64__)
|
||||
# define MANGOS_IMPORT
|
||||
# else
|
||||
|
@ -140,6 +140,23 @@ bool TargetedMovementGeneratorMedium<T, D>::Update(T& owner, const uint32& time_
|
||||
i_recheckDistance.Reset(this->GetMovementGeneratorType() == FOLLOW_MOTION_TYPE ? 50 : 100);
|
||||
G3D::Vector3 dest = owner.movespline->FinalDestination();
|
||||
targetMoved = RequiresNewPosition(owner, dest.x, dest.y, dest.z);
|
||||
if (!targetMoved)
|
||||
{
|
||||
// This unit is in hitbox of target
|
||||
// howewer we have to check if the target not moved a bit to update the orientation
|
||||
// client do it automatically 'visually' but it need this new orientation send or it will retrieve old orientation in some case (like stun)
|
||||
G3D::Vector3 currTargetPos;
|
||||
i_target->GetPosition(currTargetPos.x, currTargetPos.y, currTargetPos.z);
|
||||
if (owner.movespline->Finalized() && currTargetPos != m_prevTargetPos)
|
||||
{
|
||||
// position changed we need to adjust owner orientation to continue facing it
|
||||
m_prevTargetPos = currTargetPos;
|
||||
owner.SetInFront(i_target.getTarget()); // set movementinfo orientation, needed for next movement if any
|
||||
|
||||
float angle = owner.GetAngle(i_target.getTarget());
|
||||
owner.SetFacingTo(angle); // inform client that orientation changed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_speedChanged || targetMoved)
|
||||
@ -147,9 +164,6 @@ bool TargetedMovementGeneratorMedium<T, D>::Update(T& owner, const uint32& time_
|
||||
|
||||
if (owner.movespline->Finalized())
|
||||
{
|
||||
if (i_angle == 0.f && !owner.HasInArc(0.01f, i_target.getTarget()))
|
||||
{ owner.SetInFront(i_target.getTarget()); }
|
||||
|
||||
if (!i_targetReached)
|
||||
{
|
||||
i_targetReached = true;
|
||||
@ -199,6 +213,7 @@ void ChaseMovementGenerator<Player>::Initialize(Player& owner)
|
||||
{
|
||||
owner.addUnitState(UNIT_STAT_CHASE); // _MOVE set in _SetTargetLocation after required checks
|
||||
_setTargetLocation(owner, true);
|
||||
i_target->GetPosition(m_prevTargetPos.x, m_prevTargetPos.y, m_prevTargetPos.z);
|
||||
}
|
||||
|
||||
template<>
|
||||
@ -207,6 +222,7 @@ void ChaseMovementGenerator<Creature>::Initialize(Creature& owner)
|
||||
owner.SetWalk(false, false); // Chase movement is running
|
||||
owner.addUnitState(UNIT_STAT_CHASE); // _MOVE set in _SetTargetLocation after required checks
|
||||
_setTargetLocation(owner, true);
|
||||
i_target->GetPosition(m_prevTargetPos.x, m_prevTargetPos.y, m_prevTargetPos.z);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "MovementGenerator.h"
|
||||
#include "FollowerReference.h"
|
||||
#include "G3D/Vector3.h"
|
||||
|
||||
class PathFinder;
|
||||
|
||||
@ -71,9 +72,9 @@ class TargetedMovementGeneratorMedium
|
||||
ShortTimeTracker i_recheckDistance;
|
||||
float i_offset;
|
||||
float i_angle;
|
||||
G3D::Vector3 m_prevTargetPos;
|
||||
bool m_speedChanged : 1;
|
||||
bool i_targetReached : 1;
|
||||
|
||||
PathFinder* i_path;
|
||||
};
|
||||
|
||||
|
@ -1086,6 +1086,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
m_creature->HandleEmote(action.emoteTarget.emoteId);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1126,11 +1128,11 @@ void CreatureEventAI::Reset()
|
||||
i->Enabled = true;
|
||||
break;
|
||||
}
|
||||
// default:
|
||||
default:
|
||||
// TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
|
||||
//i->Enabled = true;
|
||||
//i->Time = 0;
|
||||
// break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ namespace MaNGOS
|
||||
|
||||
namespace XP
|
||||
{
|
||||
typedef enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY } XPColorChar;
|
||||
enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
|
||||
|
||||
inline uint32 GetGrayLevel(uint32 pl_level)
|
||||
{
|
||||
|
@ -252,7 +252,7 @@ void PlayerLogger::StartLogging(PlayerLogEntity entity)
|
||||
uint32 PlayerLogger::Stop(PlayerLogEntity entity)
|
||||
{
|
||||
SetLogActiveMask(entity, false);
|
||||
sLog.outDebug("PlayerLogger: logging type %u stopped for player %u at %u records.", entity, playerGuid, data[entity]->size());
|
||||
sLog.outDebug("PlayerLogger: logging type %u stopped for player %u at %lu records.", entity, playerGuid, data[entity]->size());
|
||||
return data[entity]->size();
|
||||
}
|
||||
|
||||
|
@ -4447,7 +4447,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (questStart)
|
||||
{
|
||||
// not in expected required quest state
|
||||
if ((!questStartCanActive || !player->IsActiveQuest(questStart)) || player->GetQuestRewardStatus(questStart))
|
||||
if ((!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart))
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
|
@ -3139,8 +3139,6 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
||||
|
||||
void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed)
|
||||
{
|
||||
MANGOS_ASSERT(spellType < CURRENT_MAX_SPELL);
|
||||
|
||||
if (m_currentSpells[spellType] && (withDelayed || m_currentSpells[spellType]->getState() != SPELL_STATE_DELAYED))
|
||||
{
|
||||
// send autorepeat cancel message for autorepeat spells
|
||||
@ -5307,7 +5305,7 @@ Unit* Unit::_GetTotem(TotemSlot slot) const
|
||||
|
||||
Totem* Unit::GetTotem(TotemSlot slot) const
|
||||
{
|
||||
if (slot >= MAX_TOTEM_SLOT || !IsInWorld() || !m_TotemSlot[slot])
|
||||
if (!IsInWorld() || !m_TotemSlot[slot])
|
||||
{ return NULL; }
|
||||
|
||||
Creature* totem = GetMap()->GetCreature(m_TotemSlot[slot]);
|
||||
@ -8812,8 +8810,8 @@ float Unit::GetObjectScaleMod() const
|
||||
// TODO:: not sure we have to do this sanity check, less than /100 or more than *100 seem not reasonable
|
||||
if (result < 0.01f)
|
||||
{ result = 0.01f; }
|
||||
else if (result > 100)
|
||||
{ result = 100; }
|
||||
else if (result > 100.0f)
|
||||
{ result = 100.0f; }
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -379,11 +379,10 @@ enum BaseModGroup
|
||||
enum BaseModType
|
||||
{
|
||||
FLAT_MOD,
|
||||
PCT_MOD
|
||||
PCT_MOD,
|
||||
MOD_END,
|
||||
};
|
||||
|
||||
#define MOD_END (PCT_MOD+1)
|
||||
|
||||
enum DeathState
|
||||
{
|
||||
ALIVE = 0, ///< show as alive
|
||||
|
@ -822,9 +822,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
|
||||
time_t mutetime = time_t (fields[7].GetUInt64());
|
||||
|
||||
locale = LocaleConstant(fields[8].GetUInt8());
|
||||
if (locale >= MAX_LOCALE)
|
||||
uint8 tmpLoc = fields[8].GetUInt8();
|
||||
if (tmpLoc >= MAX_LOCALE)
|
||||
{ locale = LOCALE_enUS; }
|
||||
else
|
||||
{ locale = LocaleConstant(tmpLoc); }
|
||||
|
||||
os = fields[9].GetString();
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "MapPersistentStateMgr.h"
|
||||
|
||||
#include "SQLStorages.h"
|
||||
#include "Player.h"
|
||||
#include "GridNotifiers.h"
|
||||
@ -41,6 +40,7 @@
|
||||
#include "Group.h"
|
||||
#include "InstanceData.h"
|
||||
#include "ProgressBar.h"
|
||||
#include <vector>
|
||||
|
||||
INSTANTIATE_SINGLETON_1(MapPersistentStateManager);
|
||||
|
||||
@ -896,9 +896,14 @@ void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32
|
||||
}
|
||||
|
||||
// remove all binds for online player
|
||||
std::vector<DungeonPersistentState*> unbindList;
|
||||
|
||||
for (PersistentStateMap::iterator itr = m_instanceSaveByInstanceId.begin(); itr != m_instanceSaveByInstanceId.end(); ++itr)
|
||||
if (itr->second->GetMapId() == mapid)
|
||||
((DungeonPersistentState*)(itr->second))->UnbindThisState();
|
||||
unbindList.push_back((DungeonPersistentState*)itr->second);
|
||||
|
||||
for (std::vector<DungeonPersistentState*>::const_iterator it = unbindList.begin(); it != unbindList.end(); ++it)
|
||||
(*it)->UnbindThisState();
|
||||
|
||||
// reset maps, teleport player automaticaly to their homebinds and unload maps
|
||||
MapPersistantStateResetWorker worker;
|
||||
|
@ -74,7 +74,7 @@ struct MassMailerQueryHandler
|
||||
|
||||
void MassMailMgr::AddMassMailTask(MailDraft* mailProto, const MailSender &sender, char const* query)
|
||||
{
|
||||
CharacterDatabase.AsyncPQuery(&massMailerQueryHandler, &MassMailerQueryHandler::HandleQueryCallback, mailProto, sender, query);
|
||||
CharacterDatabase.AsyncPQuery(&massMailerQueryHandler, &MassMailerQueryHandler::HandleQueryCallback, mailProto, sender, "%s", query);
|
||||
}
|
||||
|
||||
void MassMailMgr::Update(bool sendall /*= false*/)
|
||||
|
@ -4074,6 +4074,8 @@ void Aura::HandleShapeshiftBoosts(bool apply)
|
||||
case FORM_CREATURECAT:
|
||||
case FORM_CREATUREBEAR:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (apply)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d6cbadfec9037c160a28ec72fac9e2ebe276195a
|
||||
Subproject commit e3dd72d27b24168db3057a609af9884de5f10da4
|
Loading…
x
Reference in New Issue
Block a user