From d202a6c572ea0246b30745edf27a04c68c14e74e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 10 Aug 2022 07:40:38 +0300 Subject: [PATCH] engine: server: emulate pfnPEntityOfEntIndex bug only with explicitly enabled GoldSrc bug compatibility --- engine/server/sv_game.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index f3fe6e6e..3d789b79 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -3375,7 +3375,9 @@ pfnPEntityOfEntIndex static edict_t *pfnPEntityOfEntIndex( int iEntIndex ) { // have to be bug-compatible with GoldSrc in this function - return SV_PEntityOfEntIndex( iEntIndex, false ); + if( host.bugcomp == BUGCOMP_GOLDSRC ) + return SV_PEntityOfEntIndex( iEntIndex, false ); + return SV_PEntityOfEntIndex( iEntIndex, true ); } /*