From 9d89a347fa22662b716697c97150ddea2bd00d99 Mon Sep 17 00:00:00 2001 From: s1lent Date: Sun, 23 Dec 2018 17:49:27 +0700 Subject: [PATCH] Features: Add for iuser3 flag PLAYER_PREVENT_CLIMB --- regamedll/dlls/cdll_dll.h | 6 +----- regamedll/dlls/client.cpp | 7 +++++++ regamedll/pm_shared/pm_shared.cpp | 6 +++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/regamedll/dlls/cdll_dll.h b/regamedll/dlls/cdll_dll.h index ae228c95..cae99124 100644 --- a/regamedll/dlls/cdll_dll.h +++ b/regamedll/dlls/cdll_dll.h @@ -70,6 +70,7 @@ const int DEFAULT_FOV = 90; // the default field of view #define PLAYER_IN_BOMB_ZONE BIT(2) #define PLAYER_HOLDING_SHIELD BIT(3) #define PLAYER_PREVENT_DUCK BIT(4) +#define PLAYER_PREVENT_CLIMB BIT(5) // The player can't climb ladder #define MENU_KEY_1 BIT(0) #define MENU_KEY_2 BIT(1) @@ -82,11 +83,6 @@ const int DEFAULT_FOV = 90; // the default field of view #define MENU_KEY_9 BIT(8) #define MENU_KEY_0 BIT(9) -#define HUD_PRINTNOTIFY 1 -#define HUD_PRINTCONSOLE 2 -#define HUD_PRINTTALK 3 -#define HUD_PRINTCENTER 4 - #define WEAPON_SUIT 31 #define WEAPON_ALLWEAPONS (~(1<skin = ent->v.skin; state->effects = ent->v.effects; +#ifdef REGAMEDLL_ADD + if (ent->v.skin == CONTENTS_LADDER && + (host->v.iuser3 & PLAYER_PREVENT_CLIMB) == PLAYER_PREVENT_CLIMB) { + state->skin = CONTENTS_EMPTY; + } +#endif + if (!player && ent->v.animtime && !ent->v.velocity.x && !ent->v.velocity.y && !ent->v.velocity.z) state->eflags |= EFLAG_SLERP; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 0e742f69..f415547e 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -2838,7 +2838,11 @@ void PM_PlayerMove(qboolean server) g_onladder = FALSE; // Don't run ladder code if dead or on a train - if (!pmove->dead && !(pmove->flags & FL_ONTRAIN)) + if (!pmove->dead && !(pmove->flags & FL_ONTRAIN) +#ifdef REGAMEDLL_ADD + && !(pmove->iuser3 & PLAYER_PREVENT_CLIMB) +#endif + ) { pLadder = PM_Ladder();