MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Svcmd_RunScript_f

Function Svcmd_RunScript_f

code/game/g_svcmds.cpp:658–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658static void Svcmd_RunScript_f(void)
659{
660 const char *cmd2 = gi.argv(1);
661
662 if ( cmd2 && cmd2[0] )
663 {
664 const char *cmd3 = gi.argv(2);
665 if ( cmd3 && cmd3[0] )
666 {
667 gentity_t *found = NULL;
668 if ( (found = G_Find(NULL, FOFS(targetname), cmd2 ) ) != NULL )
669 {
670 Quake3Game()->RunScript( found, cmd3 );
671 }
672 else
673 {
674 //can't find cmd2
675 gi.Printf( S_COLOR_RED "runscript: can't find targetname %s\n", cmd2 );
676 }
677 }
678 else
679 {
680 Quake3Game()->RunScript( &g_entities[0], cmd2 );
681 }
682 }
683 else
684 {
685 gi.Printf( S_COLOR_RED "usage: runscript <ent targetname> scriptname\n" );
686 }
687}
688
689static void Svcmd_PlayerTeam_f(void)
690{

Callers

nothing calls this directly

Calls 3

Quake3GameFunction · 0.85
RunScriptMethod · 0.80
G_FindFunction · 0.70

Tested by

no test coverage detected