mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-17 13:38:18 +00:00
Add practice command /invincible to toggle invincible mode
This commit is contained in:
parent
b564110675
commit
c91be7b19f
|
@ -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;
|
||||
|
|
|
@ -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)");
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue