Skip to content

Commit

Permalink
AFKManager: Fix issue of players respawning when they shouldn't
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikk155 authored Nov 4, 2024
1 parent 5e0be13 commit bc4fdd1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/AFKManager/AFKManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dictionary gData;

dictionary gPlayerData;

void MapStart() { pJson.reload( "plugins/mikk/AFKManager.json" ); }
void MapStart() { pJson.reload( "plugins/mikk/AFKManager.json" ); AFK_TIME = 0; }

void Command( const CCommand@ args ) { AFK_TIME = atoi( args[1] ); }

Expand Down Expand Up @@ -147,13 +147,13 @@ void Join( CBasePlayer@ pPlayer, bool &in ByChat = false )

ckvd[ pPlayer, 'afkmanager_afk', true ];

if( pPlayer.IsAlive() )
if( pJson[ 'respawn on exit', false ] )
{
if( pJson[ 'respawn on exit', false ] )
{
ckvd[ pPlayer, 'afkmanager_live', true ];
}
ckvd[ pPlayer, 'afkmanager_live', pPlayer.IsAlive() ];
}

if( pPlayer.IsAlive() )
{
pPlayer.GetObserver().StartObserver( pPlayer.EyePosition(), pPlayer.pev.angles, false );

if( bool( pJson[ "spectate a player" ] ) )
Expand Down

0 comments on commit bc4fdd1

Please sign in to comment.