Merge remote-tracking branch 'origin/Networking' into Networking
This commit is contained in:
@@ -36,6 +36,18 @@ EntityWrapper EntityWrapper::FirstChildByName(const std::string& name)
|
||||
return EntityWrapper::Invalid;
|
||||
}
|
||||
|
||||
bool EntityWrapper::IsChildOf(EntityWrapper potentialParent)
|
||||
{
|
||||
EntityWrapper entity = *this;
|
||||
while (entity.Parent().Valid()) {
|
||||
entity = entity.Parent();
|
||||
if (entity == potentialParent) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EntityWrapper::Valid()
|
||||
{
|
||||
if (this->World == nullptr) {
|
||||
|
||||
@@ -48,14 +48,9 @@ void RenderSystem::fillModels(std::list<std::shared_ptr<RenderJob>>& jobs)
|
||||
}
|
||||
|
||||
EntityWrapper entity(m_World, modelComponent.EntityID);
|
||||
bool isLocalPlayer = entity == m_LocalPlayer;
|
||||
while (entity.Parent().Valid()) {
|
||||
entity = entity.Parent();
|
||||
if (entity == m_LocalPlayer) {
|
||||
isLocalPlayer = true;
|
||||
}
|
||||
}
|
||||
if (isLocalPlayer) {
|
||||
|
||||
// Don't render the local player
|
||||
if (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -149,18 +144,6 @@ void RenderSystem::fillText(std::list<std::shared_ptr<RenderJob>>& jobs, World*
|
||||
continue;
|
||||
}
|
||||
|
||||
EntityWrapper entity(m_World, textComponent.EntityID);
|
||||
bool isLocalPlayer = entity == m_LocalPlayer;
|
||||
while (entity.Parent().Valid()) {
|
||||
entity = entity.Parent();
|
||||
if (entity == m_LocalPlayer) {
|
||||
isLocalPlayer = true;
|
||||
}
|
||||
}
|
||||
if (isLocalPlayer) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Font* font;
|
||||
try {
|
||||
font = ResourceManager::Load<Font>(resource);
|
||||
|
||||
Reference in New Issue
Block a user