diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 63c9137d7..63db4bdff 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -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; diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 73606fcac..55164d835 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -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)"); } diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index dce2499dc..4d402175d 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -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);