feat(Core/Disables): Implement DISABLE_TYPE_LOOT (#15136)

This commit is contained in:
Skjalf
2023-02-19 19:20:15 -03:00
committed by GitHub
parent 86966bae73
commit a4dcec5e42
3 changed files with 19 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ namespace DisableMgr
DisableMap m_DisableMap;
uint8 MAX_DISABLE_TYPES = 10;
uint8 MAX_DISABLE_TYPES = 11;
}
void LoadDisables()
@@ -258,6 +258,8 @@ namespace DisableMgr
}
break;
}
case DISABLE_TYPE_LOOT:
break;
default:
break;
}
@@ -303,7 +305,12 @@ namespace DisableMgr
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags)
{
ASSERT(type < MAX_DISABLE_TYPES);
if (type > MAX_DISABLE_TYPES)
{
LOG_ERROR("server", "Disables::IsDisabledFor() called with unknown disable type {}! (entry {}, flags {}).", type, entry, flags);
return false;
}
if (m_DisableMap[type].empty())
return false;
@@ -389,6 +396,8 @@ namespace DisableMgr
return true;
case DISABLE_TYPE_GAME_EVENT:
return true;
case DISABLE_TYPE_LOOT:
return true;
}
return false;