Lets say we have this function in player.cpp
void Player::UpdateTriggerVisibility()
{
if (m_clientGUIDs.empty())
return;
if (!IsInWorld())
return;
UpdateData udata;
WorldPacket packet;
for (GuidSet::iterator itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr)
{
if (itr->IsCreature())
{
Creature* creature = GetMap()->GetCreature(*itr);
// Update fields of triggers, transformed units or unselectable units (values dependent on GM state)
if (!creature || (!creature->IsTrigger() && !creature->HasAuraType(SPELL_AURA_TRANSFORM) && !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)))
continue;
creature->SetFieldNotifyFlag(UF_FLAG_PUBLIC);
creature->BuildValuesUpdateBlockForPlayer(&udata, this);
creature->RemoveFieldNotifyFlag(UF_FLAG_PUBLIC);
}
else if (itr->IsGameObject())
{
GameObject* go = GetMap()->GetGameObject(*itr);
if (!go)
continue;
go->SetFieldNotifyFlag(UF_FLAG_PUBLIC);
go->BuildValuesUpdateBlockForPlayer(&udata, this);
go->RemoveFieldNotifyFlag(UF_FLAG_PUBLIC);
}
}
if (!udata.HasData())
return;
udata.BuildPacket(&packet);
GetSession()->SendPacket(&packet);
}
And we included a custom file:
#include “CustomFunctions.h”
And in this custom header file we have the same function as in that player.cpp above but a bit edited.
How to disable that function in player.cpp using a bool to compile the function from “CustomFunctions.h” instead that one from player.cpp
I heard something about #ifdef #endif