mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10623] Make .respawn work correctly with BG event spawns
This commit is contained in:
parent
2101b1ba0e
commit
22bc9c80a1
3 changed files with 33 additions and 3 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "Map.h"
|
||||
#include "Transports.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
|
||||
using namespace MaNGOS;
|
||||
|
||||
|
|
@ -208,5 +209,34 @@ bool CannibalizeObjectCheck::operator()(Corpse* u)
|
|||
return false;
|
||||
}
|
||||
|
||||
void MaNGOS::RespawnDo::operator()( Creature* u ) const
|
||||
{
|
||||
// prevent respawn creatures for not active BG event
|
||||
Map* map = u->GetMap();
|
||||
if (map->IsBattleGroundOrArena())
|
||||
{
|
||||
BattleGroundEventIdx eventId = sBattleGroundMgr.GetCreatureEventIndex(u->GetDBTableGUIDLow());
|
||||
if (!((BattleGroundMap*)map)->GetBG()->IsActiveEvent(eventId.event1, eventId.event2))
|
||||
return;
|
||||
}
|
||||
|
||||
u->Respawn();
|
||||
}
|
||||
|
||||
void MaNGOS::RespawnDo::operator()( GameObject* u ) const
|
||||
{
|
||||
// prevent respawn gameobject for not active BG event
|
||||
Map* map = u->GetMap();
|
||||
if (map->IsBattleGroundOrArena())
|
||||
{
|
||||
BattleGroundEventIdx eventId = sBattleGroundMgr.GetGameObjectEventIndex(u->GetDBTableGUIDLow());
|
||||
if (!((BattleGroundMap*)map)->GetBG()->IsActiveEvent(eventId.event1, eventId.event2))
|
||||
return;
|
||||
}
|
||||
|
||||
u->Respawn();
|
||||
}
|
||||
|
||||
|
||||
template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &);
|
||||
template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &);
|
||||
|
|
|
|||
|
|
@ -627,8 +627,8 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
RespawnDo() {}
|
||||
void operator()(Creature* u) const { u->Respawn(); }
|
||||
void operator()(GameObject* u) const { u->Respawn(); }
|
||||
void operator()(Creature* u) const;
|
||||
void operator()(GameObject* u) const;
|
||||
void operator()(WorldObject*) const {}
|
||||
void operator()(Corpse*) const {}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10622"
|
||||
#define REVISION_NR "10623"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue