feat(Core/Modules): add separated lib for modules (#9281)

This commit is contained in:
Kargatum
2021-12-02 20:28:58 +07:00
committed by GitHub
parent 8668a03e14
commit 51adbffae4
56 changed files with 1904 additions and 1014 deletions

View File

@@ -70,11 +70,6 @@
#include "WorldSession.h"
#include <math.h>
#ifdef ELUNA
#include "ElunaEventMgr.h"
#include "LuaEngine.h"
#endif
float baseMoveSpeed[MAX_MOVE_TYPE] =
{
2.5f, // MOVE_WALK
@@ -387,9 +382,8 @@ Unit::~Unit()
void Unit::Update(uint32 p_time)
{
#ifdef ELUNA
elunaEvents->Update(p_time);
#endif
sScriptMgr->OnUnitUpdate(this, p_time);
// WARNING! Order of execution here is important, do not change.
// Spells must be processed with event system BEFORE they go to _UpdateSpells.
// Or else we may have some SPELL_STATE_FINISHED spells stalled in pointers, that is bad.
@@ -12991,10 +12985,11 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration)
controlled->SetInCombatState(PvP, enemy, duration);
}
#ifdef ELUNA
if (Player* player = this->ToPlayer())
sEluna->OnPlayerEnterCombat(player, enemy);
#endif
{
sScriptMgr->OnPlayerEnterCombat(player, enemy);
}
}
void Unit::ClearInCombat()
@@ -13025,10 +13020,11 @@ void Unit::ClearInCombat()
for (uint8 i = 0; i < MAX_RUNES; ++i)
player->SetGracePeriod(i, 0);
}
#ifdef ELUNA
if (Player* player = this->ToPlayer())
sEluna->OnPlayerLeaveCombat(player);
#endif
{
sScriptMgr->OnPlayerLeaveCombat(player);
}
}
void Unit::ClearInPetCombat()