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

Debug branch for debugging purpose. #278

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
33 changes: 33 additions & 0 deletions dlls/triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,39 @@ void CBaseTrigger::MultiTouch( CBaseEntity *pOther )
}
}

// Ported from XASHXT and refactoring for debugging purporse
//=====================================================
// trigger_command: activate a console command
//=====================================================
class CTriggerCommand : public CBaseEntity
{
public:
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
virtual int ObjectCaps( void ) { return CBaseEntity :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
};
LINK_ENTITY_TO_CLASS( trigger_command, CTriggerCommand );
void CTriggerCommand::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
edict_t *pClient;
char szCommand[256];

if (pev->netname)
{
//ALERT( at_console, "Console command exec!" );
sprintf( szCommand, "%s\n", STRING( pev->netname ));
//SERVER_COMMAND( szCommand );

// manually find the single player.
pClient = g_engfuncs.pfnPEntityOfEntIndex( 1 );
// Can't play if the client is not connected!
if( !pClient )
return;

CLIENT_COMMAND( pClient, szCommand );
}
}


//
// the trigger was just touched/killed/used
// self.enemy should be set to the activator so it can be held through a delay
Expand Down