Skip to content

Commit

Permalink
Add NOTARGET flag to players during intro timer (#204)
Browse files Browse the repository at this point in the history
This should prevent NPCs from attacking
  • Loading branch information
Alienmario authored Dec 30, 2024
1 parent 6cda5cc commit 69c0275
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripting/include/srccoop/manager.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit 69c0275

Please sign in to comment.