Added EntityWrapper::IsChildOf and made snapshot interpolation and rendering exceptions for player less hacky

This commit is contained in:
2016-01-23 11:44:16 +01:00
parent 31e7340daf
commit db0e67b9bd
7 changed files with 21 additions and 24 deletions
+3 -20
View File
@@ -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);