mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Doors] Add door blacklist (#3516)
* [Doors] Add door blacklist * Renaming to simplify
This commit is contained in:
@@ -83,6 +83,8 @@ Doors::Doors(const DoorsRepository::Doors &door) :
|
||||
m_close_timer.Disable();
|
||||
|
||||
m_disable_timer = (door.disable_timer == 1 ? true : false);
|
||||
|
||||
m_is_blacklisted_to_open = GetIsDoorBlacklisted();
|
||||
}
|
||||
|
||||
Doors::Doors(const char *model, const glm::vec4 &position, uint8 open_type, uint16 size) :
|
||||
@@ -901,3 +903,27 @@ bool Doors::IsDestinationZoneSame() const
|
||||
{
|
||||
return m_same_destination_zone;
|
||||
}
|
||||
|
||||
// IsDoorBlacklisted has a static list of doors that are blacklisted
|
||||
// from being opened by NPCs. This is used to prevent NPCs from opening
|
||||
// doors that are not meant to be opened by NPCs.
|
||||
bool Doors::GetIsDoorBlacklisted()
|
||||
{
|
||||
std::vector<std::string> blacklist = {
|
||||
"TOGGLE",
|
||||
"PNDRESSER101",
|
||||
};
|
||||
|
||||
for (auto& name : blacklist) {
|
||||
std::string door_name = GetDoorName();
|
||||
if (name == door_name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Doors::IsDoorBlacklisted() {
|
||||
return m_is_blacklisted_to_open;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user