From c1e1284b52ef5d2934e40172057cdf8bf270a983 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 1 Feb 2019 18:15:49 +0100 Subject: [PATCH] - moved the CCMDs out of a_pickups.cpp. --- src/g_dumpinfo.cpp | 42 +++++++++++++++++++++++++++++ src/g_shared/a_pickups.cpp | 55 +------------------------------------- 2 files changed, 43 insertions(+), 54 deletions(-) diff --git a/src/g_dumpinfo.cpp b/src/g_dumpinfo.cpp index 9501b452f..e967f724b 100644 --- a/src/g_dumpinfo.cpp +++ b/src/g_dumpinfo.cpp @@ -41,6 +41,7 @@ #include "p_setup.h" #include "w_wad.h" #include "v_text.h" +#include "c_functions.h" //========================================================================== // @@ -305,5 +306,46 @@ CCMD(dumplinktable) } +//=========================================================================== +// +// CCMD printinv +// +// Prints the console player's current inventory. +// +//=========================================================================== +CCMD(printinv) +{ + int pnum = consoleplayer; + +#ifdef _DEBUG + // Only allow peeking on other players' inventory in debug builds. + if (argv.argc() > 1) + { + pnum = atoi(argv[1]); + if (pnum < 0 || pnum >= MAXPLAYERS) + { + return; + } + } +#endif + C_PrintInv(players[pnum].mo); +} + +CCMD(targetinv) +{ + FTranslatedLineTarget t; + + if (CheckCheatmode() || players[consoleplayer].mo == NULL) + return; + + C_AimLine(&t, true); + + if (t.linetarget) + { + C_PrintInv(t.linetarget); + } + else Printf("No target found. Targetinv cannot find actors that have " + "the NOBLOCKMAP flag or have height/radius of 0.\n"); +} diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index fdb0b22f4..98347df84 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -35,21 +35,11 @@ #include -#include "info.h" -#include "p_local.h" -#include "p_lnspec.h" -#include "sbar.h" -#include "statnums.h" -#include "c_dispatch.h" #include "gstrings.h" -#include "a_morph.h" -#include "a_specialspot.h" -#include "g_game.h" +#include "sbar.h" #include "doomstat.h" #include "d_player.h" -#include "serializer.h" #include "vm.h" -#include "c_functions.h" #include "g_levellocals.h" EXTERN_CVAR(Bool, sv_unlimited_pickup) @@ -115,46 +105,3 @@ bool CallTryPickup(AActor *item, AActor *toucher, AActor **toucher_return) return !!res; } -//=========================================================================== -// -// CCMD printinv -// -// Prints the console player's current inventory. -// -//=========================================================================== - -CCMD (printinv) -{ - int pnum = consoleplayer; - -#ifdef _DEBUG - // Only allow peeking on other players' inventory in debug builds. - if (argv.argc() > 1) - { - pnum = atoi (argv[1]); - if (pnum < 0 || pnum >= MAXPLAYERS) - { - return; - } - } -#endif - C_PrintInv(players[pnum].mo); -} - -CCMD (targetinv) -{ - FTranslatedLineTarget t; - - if (CheckCheatmode () || players[consoleplayer].mo == NULL) - return; - - C_AimLine(&t, true); - - if (t.linetarget) - { - C_PrintInv(t.linetarget); - } - else Printf("No target found. Targetinv cannot find actors that have " - "the NOBLOCKMAP flag or have height/radius of 0.\n"); -} -