Skip to content

Commit

Permalink
Add missiles to tile data debug command
Browse files Browse the repository at this point in the history
  • Loading branch information
obligaron authored and AJenbo committed Feb 3, 2025
1 parent 4f9e063 commit ee42d2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "engine/load_cel.hpp"
#include "engine/point.hpp"
#include "lighting.h"
#include "missiles.h"
#include "monster.h"
#include "plrmsg.h"
#include "utils/str_case.hpp"
Expand Down Expand Up @@ -208,6 +209,16 @@ bool GetDebugGridText(Point dungeonCoords, std::string &debugGridText)
case DebugGridTextItem::dMonster:
info = dMonster[dungeonCoords.x][dungeonCoords.y];
break;
case DebugGridTextItem::missiles: {
for (auto &missile : Missiles) {
if (missile.position.tile == dungeonCoords) {
if (!debugGridText.empty()) debugGridText += '\n';
debugGridText.append(std::to_string((int)missile._mitype));
}
}
if (debugGridText.empty()) return false;
return true;
} break;
case DebugGridTextItem::dCorpse:
info = dCorpse[dungeonCoords.x][dungeonCoords.y];
break;
Expand Down
1 change: 1 addition & 0 deletions Source/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum class DebugGridTextItem : uint16_t {
dFlags,
dPlayer,
dMonster,
missiles,
dCorpse,
dObject,
dItem,
Expand Down
3 changes: 2 additions & 1 deletion Source/lua/modules/dev/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std::string DebugCmdFullbright(std::optional<bool> on)

std::string DebugCmdShowTileData(std::optional<std::string_view> dataType)
{
static const std::array<std::string_view, 22> DataTypes {
static const std::array<std::string_view, 23> DataTypes {
"microTiles",
"dPiece",
"dTransVal",
Expand All @@ -51,6 +51,7 @@ std::string DebugCmdShowTileData(std::optional<std::string_view> dataType)
"dFlags",
"dPlayer",
"dMonster",
"missiles",
"dCorpse",
"dObject",
"dItem",
Expand Down

0 comments on commit ee42d2a

Please sign in to comment.