Skip to content

Commit

Permalink
entity_info: allow to see the exact origin of the brush entities (#276)
Browse files Browse the repository at this point in the history
* entity_info: allow to see the exact origin of the entities

* entity_info: apply that fix only for brush entities

* entity_info: checking to bsp flags instead of func_ classname
  • Loading branch information
SmileyAG authored Mar 24, 2022
1 parent 984a32e commit 69ee6e0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions BunnymodXT/hud_custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,17 @@ namespace CustomHud
{
out << "Yaw: " << ent->v.angles[1] << '\n';

out << "X: " << ent->v.origin.x << '\n';
out << "Y: " << ent->v.origin.y << '\n';
out << "Z: " << ent->v.origin.z << '\n';
// Borrowed from https://github.com/SNMetamorph/goldsrc-monitor/blob/08c368e246d09996b2d85e4367d4d8cc1e507712/sources/library/displaymode_entityreport.cpp#L45
Vector origin;

if (ent->v.solid == SOLID_BSP || ent->v.movetype == MOVETYPE_PUSHSTEP)
origin = ent->v.origin + ((ent->v.mins + ent->v.maxs) / 2.f);
else
origin = ent->v.origin;

out << "X: " << origin.x << '\n';
out << "Y: " << origin.y << '\n';
out << "Z: " << origin.z << '\n';

out << "X Vel: " << ent->v.velocity.x << '\n';
out << "Y Vel: " << ent->v.velocity.y << '\n';
Expand Down

0 comments on commit 69ee6e0

Please sign in to comment.