diff options
| author | Narendra Umate <[email protected]> | 2013-12-08 01:27:41 -0800 |
|---|---|---|
| committer | Narendra Umate <[email protected]> | 2013-12-08 01:27:41 -0800 |
| commit | 4fa56874ba1557274c10077bf8386ece4c61dbd6 (patch) | |
| tree | e2d336604e960b548e996d2e7dcfc5a1e1401b9e /mp/src/game/server/entity_tools_server.cpp | |
| parent | Added DS_Store to .gitignore. (diff) | |
| parent | Make libSDL2.so/dylib into symlinks. (diff) | |
| download | source-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.tar.xz source-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.zip | |
Merge remote-tracking branch 'upstream/master'
Reverted .gitattributes xcode_ccache_wrapper change. Fixed line endings
for .gitignore and .gitattributes.
Diffstat (limited to 'mp/src/game/server/entity_tools_server.cpp')
| -rw-r--r-- | mp/src/game/server/entity_tools_server.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/mp/src/game/server/entity_tools_server.cpp b/mp/src/game/server/entity_tools_server.cpp index e1888123..5032ca04 100644 --- a/mp/src/game/server/entity_tools_server.cpp +++ b/mp/src/game/server/entity_tools_server.cpp @@ -409,13 +409,39 @@ void CC_Ent_Keyvalue( const CCommand &args ) return; } - int nID = atoi( args[1] ); + CBasePlayer *pPlayer = ToBasePlayer( UTIL_GetCommandClient() ); + CBaseEntity *pEnt; + if ( FStrEq( args[1], "" ) || FStrEq( args[1], "!picker" ) ) + { + if (!pPlayer) + return; + + extern CBaseEntity *FindPickerEntity( CBasePlayer *pPlayer ); + pEnt = FindPickerEntity( pPlayer ); - CBaseEntity *pEnt = g_ServerTools.FindEntityByHammerID( nID ); - if ( !pEnt ) + if ( !pEnt ) + { + ClientPrint( pPlayer, HUD_PRINTCONSOLE, "No entity in front of player.\n" ); + return; + } + } + else if ( FStrEq( args[1], "!self" ) || FStrEq( args[1], "!caller" ) || FStrEq( args[1], "!activator" ) ) { - Msg( "Entity ID %d not found.\n", nID ); - return; + if (!pPlayer) + return; + + pEnt = pPlayer; + } + else + { + int nID = atoi( args[1] ); + + pEnt = g_ServerTools.FindEntityByHammerID( nID ); + if ( !pEnt ) + { + Msg( "Entity ID %d not found.\n", nID ); + return; + } } int nArg = 2; |