Skip to content

Commit

Permalink
Make some GOs always break LOS
Browse files Browse the repository at this point in the history
ported fro vmangos
  • Loading branch information
celguar committed Mar 25, 2024
1 parent 049385b commit 7813293
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/game/Entities/GameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,16 @@ struct GameObjectInfo
default: return false;
}
}

bool CanAlwaysBreakLoS() const
{
switch (type)
{
case GAMEOBJECT_TYPE_DOOR: return true;
case GAMEOBJECT_TYPE_GENERIC: return true;
default: return false;
}
}
};

// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
Expand Down
2 changes: 1 addition & 1 deletion src/game/vmap/GameObjectModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool GameObjectModel::initialize(const GameObject* const pGo, const GameObjectDi
if (!iModel)
return false;

if (it->second.name.find(".m2") != std::string::npos)
if (!pGo->GetGOInfo()->CanAlwaysBreakLoS() && it->second.name.find(".m2") != std::string::npos)
iModel->setModelFlags(VMAP::MOD_M2);

name = it->second.name;
Expand Down

0 comments on commit 7813293

Please sign in to comment.