diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 56c1eeef9..858d608f9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -559,6 +559,14 @@ void D_RegisterClientCommands(void) COM_AddDebugCommand("scale", Command_Scale_f); COM_AddDebugCommand("gravflip", Command_Gravflip_f); COM_AddDebugCommand("hurtme", Command_Hurtme_f); + COM_AddDebugCommand("stumble", Command_Stumble_f); + COM_AddDebugCommand("tumble", Command_Tumble_f); + COM_AddDebugCommand("whumble", Command_Whumble_f); + COM_AddDebugCommand("explode", Command_Explode_f); + COM_AddDebugCommand("spinout", Command_Spinout_f); + COM_AddDebugCommand("wipeout", Command_Wipeout_f); + COM_AddDebugCommand("sting", Command_Sting_f); + COM_AddDebugCommand("kill", Command_Kill_f); COM_AddDebugCommand("teleport", Command_Teleport_f); COM_AddDebugCommand("rteleport", Command_RTeleport_f); COM_AddDebugCommand("skynum", Command_Skynum_f); @@ -5924,10 +5932,13 @@ static void Got_Cheat(const UINT8 **cp, INT32 playernum) if (!P_MobjWasRemoved(player->mo)) { - P_DamageMobj(player->mo, NULL, NULL, damage, DMG_NORMAL); + if (damage >= DMG_INSTAKILL) + P_KillMobj(player->mo, NULL, NULL, (UINT8)damage); + else + P_DamageMobj(player->mo, NULL, NULL, 1, (UINT8)damage); } - CV_CheaterWarning(targetPlayer, va("%d damage to me", damage)); + CV_CheaterWarning(targetPlayer, va("damage (flags=%d) to me", damage)); break; } diff --git a/src/k_kart.c b/src/k_kart.c index 8ce6ba3f8..26b9ffdee 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5449,7 +5449,7 @@ void K_DebtStingPlayer(player_t *player, mobj_t *source) { INT32 length = TICRATE; - if (source->player) + if (source && !P_MobjWasRemoved(source) && source->player) { length += (4 * (source->player->kartweight - player->kartweight)); } diff --git a/src/m_cheat.c b/src/m_cheat.c index 48b51f412..3c48ec521 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -115,13 +115,82 @@ void Command_Hurtme_f(void) if (COM_Argc() < 2) { - CONS_Printf(M_GetText("hurtme : Damage yourself by a specific amount\n")); + CONS_Printf(M_GetText("hurtme : Damage yourself with specific flags\n")); + CONS_Printf(M_GetText("Norm 0 Wipe 1 Expl 2 Tumb 3 Stng 4\n")); + CONS_Printf(M_GetText("Krma 5 Volt 6 Stmb 7 Whmb 8\n")); + CONS_Printf(M_GetText("Ikll 128 Dpit 129 Crsh 130 Spec 131 Time 132\n")); + CONS_Printf(M_GetText("Wmbo 16 Stel 32 Hslf 64\n")); return; } D_Cheat(consoleplayer, CHEAT_HURT, atoi(COM_Argv(1))); } +void Command_Spinout_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_NORMAL); +} + +void Command_Wipeout_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_WIPEOUT); +} + +void Command_Explode_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_EXPLODE); +} + +void Command_Sting_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_STING); +} + + +void Command_Tumble_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_TUMBLE); +} + +void Command_Stumble_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_STUMBLE); +} + +void Command_Whumble_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_WHUMBLE); +} + +void Command_Kill_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_HURT, DMG_INSTAKILL); +} + void Command_RTeleport_f(void) { float x = atof(COM_Argv(1)); diff --git a/src/m_cheat.h b/src/m_cheat.h index 8618fc1b1..1ee2707fe 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -80,6 +80,16 @@ void Command_Devmode_f(void); void Command_Scale_f(void); void Command_Gravflip_f(void); void Command_Hurtme_f(void); + +void Command_Stumble_f(void); +void Command_Whumble_f(void); +void Command_Tumble_f(void); +void Command_Explode_f(void); +void Command_Spinout_f(void); +void Command_Wipeout_f(void); +void Command_Sting_f(void); +void Command_Kill_f(void); + void Command_Teleport_f(void); void Command_RTeleport_f(void); void Command_Skynum_f(void);