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

Fix RCON crashes #126

Merged
merged 3 commits into from
Sep 21, 2018
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

## [v1.3.0.0](https://github.com/BSVino/DoubleAction/tree/v1.3.0.0) (2018-04-09)
## [v1.3.0.0](https://github.com/BSVino/DoubleAction/tree/v1.3.0.0) (2018-04-08)
[Full Changelog](https://github.com/BSVino/DoubleAction/compare/v1.2.2.2...v1.3.0.0)

**Implemented enhancements:**
Expand Down
20 changes: 18 additions & 2 deletions mp/src/game/server/ai_concommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ ConVar npc_create_equipment("npc_create_equipment", "");
//------------------------------------------------------------------------------
void CC_NPC_Create( const CCommand &args )
{
CBasePlayer* pPlayer = UTIL_GetCommandClient();

if (!pPlayer)
return;

MDLCACHE_CRITICAL_SECTION();

bool allowPrecache = CBaseEntity::IsPrecacheAllowed();
Expand All @@ -414,7 +419,6 @@ void CC_NPC_Create( const CCommand &args )

DispatchSpawn(baseNPC);
// Now attempt to drop into the world
CBasePlayer* pPlayer = UTIL_GetCommandClient();
trace_t tr;
Vector forward;
pPlayer->EyeVectors( &forward );
Expand Down Expand Up @@ -462,6 +466,11 @@ static ConCommand npc_create("npc_create", CC_NPC_Create, "Creates an NPC of the
//------------------------------------------------------------------------------
void CC_NPC_Create_Aimed( const CCommand &args )
{
CBasePlayer* pPlayer = UTIL_GetCommandClient();

if (!pPlayer)
return;

MDLCACHE_CRITICAL_SECTION();

bool allowPrecache = CBaseEntity::IsPrecacheAllowed();
Expand All @@ -477,7 +486,6 @@ void CC_NPC_Create_Aimed( const CCommand &args )

// Now attempt to drop into the world
QAngle angles;
CBasePlayer* pPlayer = UTIL_GetCommandClient();
trace_t tr;
Vector forward;
pPlayer->EyeVectors( &forward );
Expand Down Expand Up @@ -632,6 +640,10 @@ CON_COMMAND(npc_thinknow, "Trigger NPC to think")
void CC_NPC_Teleport( void )
{
CBasePlayer* pPlayer = UTIL_GetCommandClient();

if (!pPlayer)
return;

trace_t tr;
Vector forward;
pPlayer->EyeVectors( &forward );
Expand Down Expand Up @@ -664,6 +676,10 @@ static ConVar npc_go_do_run( "npc_go_do_run", "1", 0, "Set whether should run on
void CC_NPC_Go( void )
{
CBasePlayer* pPlayer = UTIL_GetCommandClient();

if (!pPlayer)
return;

trace_t tr;
Vector forward;
pPlayer->EyeVectors( &forward );
Expand Down
3 changes: 3 additions & 0 deletions mp/src/game/server/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5811,6 +5811,9 @@ CBaseEntity *FindPickerEntity( CBasePlayer *pPlayer )
//-----------------------------------------------------------------------------
CAI_Node *FindPickerAINode( CBasePlayer *pPlayer, NodeType_e nNodeType )
{
if (!pPlayer)
return NULL;

Vector forward;
Vector origin;

Expand Down
5 changes: 4 additions & 1 deletion mp/src/game/server/sdk/bots/sdk_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,13 @@ void CSDKBot::BotThink()
RunPlayerMove( cmd, gpGlobals->frametime );
}

CON_COMMAND_F( bot_teleport, "Give weapon to player.\n\tArguments: <weapon_name>", FCVAR_CHEAT )
CON_COMMAND_F( bot_teleport, "Teleports the first bot to the player.", FCVAR_CHEAT )
{
CBasePlayer *pPlayer = ToBasePlayer( UTIL_GetCommandClient() );

if (!pPlayer)
return;

Vector vecEye = pPlayer->GetAbsOrigin() + pPlayer->GetViewOffset();

Vector vecForward;
Expand Down
7 changes: 7 additions & 0 deletions mp/src/game/server/sdk/sdk_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4891,6 +4891,10 @@ CON_COMMAND( vr, "Turn VR mode on/off" )
return;

CSDKPlayer *pPlayer = ToSDKPlayer( UTIL_GetCommandClient() );

if (!pPlayer)
return;

pPlayer->m_bUsingVR = V_strcmp(args[1], "on") == 0;
}

Expand All @@ -4901,6 +4905,9 @@ CON_COMMAND( platform, "Indicate client platform" )

CSDKPlayer *pPlayer = ToSDKPlayer( UTIL_GetCommandClient() );

if (!pPlayer)
return;

pPlayer->m_iPlatform = 0;

if (V_strcmp(args[1], "windows") == 0)
Expand Down