Skip to content

Commit

Permalink
Allow to draw triggers in software engine with HUD_AddEntity if cvar …
Browse files Browse the repository at this point in the history
…value above 0
  • Loading branch information
SmileyAG committed Dec 14, 2023
1 parent 49c1310 commit bac94f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cl_dll/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

#include "particleman.h"

#include "r_studioint.h"

extern engine_studio_api_t IEngineStudio;

#undef min
#undef max

Expand Down Expand Up @@ -57,8 +61,8 @@ int CL_DLLEXPORT HUD_AddEntity( int type, struct cl_entity_s *ent, const char *m

// show triggers that would be transferred from server-side with specific value in renderfx to differ it from other entities
// update: there is a new implementation of displaying triggers that allows you to display even when planes is stripped due to optimizations in updated map compiler
// so this code will only work if the value 2 is specified in the cvar, but it should not be deleted imo
if ((ent->curstate.rendermode == kRenderTransColor) && (ent->curstate.renderfx == kRenderFxTrigger) && (gHUD.m_pShowServerTriggers->value == 2.0f) && !gHUD.IsTriggerForSinglePlayer(ent->curstate.rendercolor))
// so for hardware engine this code will only work if the value 2 is specified in the cvar
if ((ent->curstate.rendermode == kRenderTransColor) && (ent->curstate.renderfx == kRenderFxTrigger) && (gHUD.m_pShowServerTriggers->value == 2.0f || (!IEngineStudio.IsHardware && gHUD.m_pShowServerTriggers->value > 0)) && !gHUD.IsTriggerForSinglePlayer(ent->curstate.rendercolor))
ent->curstate.renderamt = std::min(255.0f, std::max(0.0f, gHUD.m_pShowServerTriggersAlpha->value));

// hide corpses option
Expand Down

0 comments on commit bac94f7

Please sign in to comment.