Skip to content

Commit

Permalink
Apply element filter for buildings in engineApplyShaderToWorldTexture
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Jan 22, 2025
1 parent bf689fd commit 0e65828
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions Client/game_sa/CBuildingsPoolSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CBuildingsPoolSA : public CBuildingsPool
void RestoreBackup() override;
bool Resize(int size) override;
int GetSize() const override { return (*m_ppBuildingPoolInterface)->m_nSize; };
CClientEntity* GetClientBuilding(CBuildingSAInterface* pGameInterface) const noexcept;

private:
void RemoveBuildingFromWorld(CBuildingSAInterface* pBuilding);
Expand Down
6 changes: 5 additions & 1 deletion Client/game_sa/CPoolsSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,12 @@ CClientEntity* CPoolsSA::GetClientEntity(DWORD* pGameInterface)
{
return pThePedEntity->pClientEntity;
}

auto clientBuilding = m_BuildingsPool.GetClientBuilding(reinterpret_cast<CBuildingSAInterface*>(pGameInterface));
if (clientBuilding)
return clientBuilding;
}
return NULL;
return nullptr;
}

static void CreateMissionTrain(const CVector& vecPos, bool bDirection, std::uint32_t uiTrainType, CTrainSAInterface** ppTrainBeginning,
Expand Down
3 changes: 3 additions & 0 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3734,6 +3734,9 @@ void CClientGame::StaticGameEntityRenderHandler(CEntitySAInterface* pGameEntity)
case CCLIENTOBJECT:
iTypeMask = TYPE_MASK_OBJECT;
break;
case CCLIENTBUILDING:
iTypeMask = TYPE_MASK_WORLD;
break;
default:
iTypeMask = TYPE_MASK_OTHER;
break;
Expand Down
4 changes: 2 additions & 2 deletions Client/multiplayer_sa/multiplayersa_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ void LogEvent(uint uiDebugId, const char* szType, const char* szContext, const c

void CallGameEntityRenderHandler(CEntitySAInterface* pEntity)
{
// Only call if not a building or a dummy
if (!pEntity || (pEntity->nType != ENTITY_TYPE_BUILDING && pEntity->nType != ENTITY_TYPE_DUMMY))
// Only call if not a dummy
if (!pEntity || pEntity->nType != ENTITY_TYPE_DUMMY)
if (pGameEntityRenderHandler)
pGameEntityRenderHandler(pEntity);
}

0 comments on commit 0e65828

Please sign in to comment.