From 69c02752db480c4b774b5ede68fdb91a4c32c495 Mon Sep 17 00:00:00 2001 From: Alienmario Date: Mon, 30 Dec 2024 03:32:39 +0100 Subject: [PATCH] Add NOTARGET flag to players during intro timer (#204) This should prevent NPCs from attacking --- scripting/include/srccoop/manager.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripting/include/srccoop/manager.inc b/scripting/include/srccoop/manager.inc index 1885ffc0..9e3596c7 100644 --- a/scripting/include/srccoop/manager.inc +++ b/scripting/include/srccoop/manager.inc @@ -269,12 +269,12 @@ methodmap CoopManager { if (g_pLevelLump.m_iIntroType == INTRO_FADE) { - pPlayer.m_fFlags |= (FL_ATCONTROLS | FL_FROZEN); // Freeze controls and angles. + pPlayer.m_fFlags |= (FL_ATCONTROLS | FL_FROZEN | FL_NOTARGET); // Freeze controls and angles. Client_ScreenFade(pPlayer.entindex, 0, FFADE_STAYOUT); } else if (g_pLevelLump.m_iIntroType == INTRO_FREEZE) { - pPlayer.m_fFlags |= FL_ATCONTROLS; // Freeze controls. + pPlayer.m_fFlags |= (FL_ATCONTROLS | FL_NOTARGET); // Freeze controls. Client_ScreenFade(pPlayer.entindex, Conf.FROZEN_FADE_DUR_IN, FFADE_OUT | FFADE_STAYOUT, _, Conf.FROZEN_FADE_COLOR[0], Conf.FROZEN_FADE_COLOR[1], Conf.FROZEN_FADE_COLOR[2], Conf.FROZEN_FADE_COLOR[3]); } @@ -583,14 +583,14 @@ public Action Timer_DecrementUntilMapStart(Handle hTimer) { if (IsClientInGame(i) && !IsFakeClient(i)) { - CBasePlayer pClient = CBasePlayer(i); + CBasePlayer pPlayer = CBasePlayer(i); // TODO: Look into this. // `FL_FROZEN` is being removed even without the below line in Black Mesa (i doubt this affects other games). // `CBM_MP_GameRules.SetStateEndTime` might be the culprit and might have side effects for other behaviors too. - pClient.m_fFlags &= ~(FL_ATCONTROLS | FL_FROZEN); + pPlayer.m_fFlags &= ~(FL_ATCONTROLS | FL_FROZEN | FL_NOTARGET); if (g_pLevelLump.m_iIntroType == INTRO_FREEZE) { - Client_ScreenFade(pClient.entindex, Conf.FROZEN_FADE_DUR_OUT, FFADE_PURGE | FFADE_IN, 1, + Client_ScreenFade(pPlayer.entindex, Conf.FROZEN_FADE_DUR_OUT, FFADE_PURGE | FFADE_IN, 1, Conf.FROZEN_FADE_COLOR[0], Conf.FROZEN_FADE_COLOR[1], Conf.FROZEN_FADE_COLOR[2], Conf.FROZEN_FADE_COLOR[3]); } }