diff --git a/BunnymodXT/modules/HwDLL.cpp b/BunnymodXT/modules/HwDLL.cpp index 7cbab9f3..f2249a41 100644 --- a/BunnymodXT/modules/HwDLL.cpp +++ b/BunnymodXT/modules/HwDLL.cpp @@ -3923,6 +3923,34 @@ struct HwDLL::Cmd_BXT_Print_Entities } }; +struct HwDLL::Cmd_BXT_Print_Entities_By_Index +{ + USAGE("Usage: bxt_print_entities_by_index \n"); + + static void handler(int value1, int value2) + { + const auto& hw = HwDLL::GetInstance(); + + std::ostringstream out; + + edict_t* edicts; + const int numEdicts = hw.GetEdicts(&edicts); + for (int e = 0; e < numEdicts; ++e) { + const edict_t* ent = edicts + e; + if (!hw.IsValidEdict(ent)) + continue; + + if ((e < value1) || (e > value2)) + continue; + + HwDLL::GetInstance().PrintEntities(out, e, ent); + } + + auto str = out.str(); + hw.ORIG_Con_Printf("%s", str.c_str()); + } +}; + void HwDLL::GetOriginOfEntity(Vector& origin, const edict_t* ent) { const auto& hw = HwDLL::GetInstance(); @@ -4890,6 +4918,7 @@ void HwDLL::RegisterCVarsAndCommandsIfNeeded() wrapper::Add>("bxt_append"); wrapper::Add>("bxt_freecam"); wrapper::Add, Handler>("bxt_print_entities"); + wrapper::Add>("bxt_print_entities_by_index"); wrapper::Add>("bxt_tas_editor_resimulate"); wrapper::Add>("bxt_tas_editor_apply_smoothing"); diff --git a/BunnymodXT/modules/HwDLL.hpp b/BunnymodXT/modules/HwDLL.hpp index 24f39362..b360e16f 100644 --- a/BunnymodXT/modules/HwDLL.hpp +++ b/BunnymodXT/modules/HwDLL.hpp @@ -475,6 +475,7 @@ class HwDLL : public IHookableNameFilterOrdered struct Cmd_BXT_TAS_Optim_Init; struct Cmd_BXT_FreeCam; struct Cmd_BXT_Print_Entities; + struct Cmd_BXT_Print_Entities_By_Index; struct Cmd_BXT_TAS_Become_Simulator_Client; struct Cmd_BXT_TAS_Server_Send_Command; struct Cmd_BXT_TAS_Client_Load_Received_Script;