Add practice command /invincible to toggle invincible mode

This commit is contained in:
Tim Schumacher 2024-09-26 19:07:37 +02:00
parent b564110675
commit c91be7b19f
3 changed files with 9 additions and 0 deletions

View file

@ -2167,6 +2167,13 @@ void CGameContext::ConPracticeUnNinja(IConsole::IResult *pResult, void *pUserDat
ConUnNinja(pResult, pUserData);
}
void CGameContext::ConPracticeToggleInvincible(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
if(pSelf->GetPracticeCharacter(pResult))
ConToggleInvincible(pResult, pUserData);
}
void CGameContext::ConPracticeAddWeapon(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;

View file

@ -3821,6 +3821,7 @@ void CGameContext::RegisterChatCommands()
Console()->Register("unweapons", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeUnWeapons, this, "Removes all weapons from you");
Console()->Register("ninja", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeNinja, this, "Makes you a ninja");
Console()->Register("unninja", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeUnNinja, this, "Removes ninja from you");
Console()->Register("invincible", "?i['0'|'1']", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeToggleInvincible, this, "Toggles invincible mode");
Console()->Register("kill", "", CFGFLAG_CHAT | CFGFLAG_SERVER, ConProtectedKill, this, "Kill yourself when kill-protected during a long game (use f1, kill for regular kill)");
}

View file

@ -493,6 +493,7 @@ private:
static void ConPracticeUnWeapons(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeNinja(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeUnNinja(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeToggleInvincible(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeAddWeapon(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeRemoveWeapon(IConsole::IResult *pResult, void *pUserData);