Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helper_functions: added IsBSPModel and get_origin_of_entity functions #544

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SmileyAG
Copy link
Collaborator

Rebase after #540 is merged

IsBSPModel - function from HLSDK to determine if it is brush entity or not

get_origin_of_entity - custom function to get origin based on if it is brush entity or not (but this does not work correctly with some entities, e.g. trigger_, because those coordinates are also based on the center point, but the IsBSPModel from HLSDK does not take them into account, and I don’t want to use hacks yet for that because this is not really necessary for the current code)

Comment on lines -4784 to -4787
bool is_trigger = std::strncmp(classname, "trigger_", 8) == 0;
bool is_ladder = std::strncmp(classname, "func_ladder", 11) == 0;
bool is_friction = std::strncmp(classname, "func_friction", 13) == 0;
bool is_water = std::strncmp(classname, "func_water", 10) == 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems relevant at least for teleport to entity?

Copy link
Collaborator Author

@SmileyAG SmileyAG Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in general, yes, but at first thought I thinked about making a separate mode or cmd that will teleport to the center point of the entity.

Although I'll probably try to think more about how to better determine cases when an adjustment in the position for entities is needed, because the HLSDK function does not handle that types of brush entities.

Copy link
Collaborator Author

@SmileyAG SmileyAG Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But still, if nothing better happens, then it will be possible to return to the initial version, when all entities whose classname begins with trigger_ and func_ are set to the origin of the point from the center, stupid - but better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants