Added EntityWrapper::IsChildOf and made snapshot interpolation and rendering exceptions for player less hacky
This commit is contained in:
@@ -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