Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcerespawn fix #623

Merged
merged 4 commits into from
Jun 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10045,18 +10045,30 @@ void CBasePlayer::PlayerRespawnThink()
if (pev->deadflag < DEAD_DYING)
return;

if (CSPlayer()->m_flRespawnPending > 0 &&
CSPlayer()->m_flRespawnPending <= gpGlobals->time)
if (CSPlayer()->m_flRespawnPending > 0)
{
// Pending respawn caused by game doesn't respawn with disabled CVar
if (CSPlayer()->m_bGameForcingRespawn && !forcerespawn.value)
return;
if (CSPlayer()->m_flRespawnPending <= gpGlobals->time)
{
// Pending respawn caused by game doesn't respawn with disabled CVar
if (CSPlayer()->m_bGameForcingRespawn && !forcerespawn.value)
{
CSPlayer()->m_flRespawnPending = 0.0f;
CSPlayer()->m_bGameForcingRespawn = false;
return;
}

Spawn();
pev->button = 0;
pev->nextthink = -1;
return;
Spawn();
pev->button = 0;
pev->nextthink = -1;
return;
}
}
else if (pev->deadflag == DEAD_DEAD && forcerespawn.value > 0)
{
CSPlayer()->m_bGameForcingRespawn = true;
CSPlayer()->m_flRespawnPending = gpGlobals->time + forcerespawn.value;
}

#endif
}

Expand Down
1 change: 0 additions & 1 deletion regamedll/msvc/ReGameDLL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,6 @@
<ProjectGuid>{70A2B904-B7DB-4C48-8DE0-AF567360D572}</ProjectGuid>
<RootNamespace>ReGameDLL</RootNamespace>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down