MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / AddCommand

Method AddCommand

CryGame/ScriptObjectGame.cpp:1447–1470  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1445
1446//////////////////////////////////////////////////////////////////////////
1447int CScriptObjectGame::AddCommand(IFunctionHandler *pH)
1448{
1449 int nPCount=pH->GetParamCount();
1450 const char *sName;
1451 const char *sCommand;
1452 const char *sHelp=NULL;
1453 int iflags=0;
1454 pH->GetParam(1,sName);
1455 if (nPCount>1)
1456 {
1457 pH->GetParam(2,sCommand);
1458 if (nPCount>2)
1459 {
1460 if (!pH->GetParam(3,sHelp))
1461 sHelp=NULL;
1462 }
1463 if (sHelp)
1464 m_pConsole->AddCommand(sName,sCommand,0,sHelp);
1465 else
1466 m_pConsole->AddCommand(sName,sCommand,VF_NOHELP,"");
1467 }
1468
1469 return pH->EndFunction();
1470}
1471
1472//////////////////////////////////////////////////////////////////////////
1473int CScriptObjectGame::GetLevelName(IFunctionHandler *pH)

Callers 2

InitConsoleCommandsMethod · 0.45

Calls 3

EndFunctionMethod · 0.80
GetParamCountMethod · 0.45
GetParamMethod · 0.45

Tested by

no test coverage detected