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

Rename handlers and events for entity processing consistency #3925

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

Conversation

lynconsix
Copy link

The change from onClientPedsProcessed to onClientEntitiesProcessed indicates that the event is not only related to pedestrians, but can also be used on various elements, for example: #3922 The idea to revive the event came from this issue.

The ped manipulators have also been renamed to entities.

@botder
Copy link
Member

botder commented Jan 4, 2025

Can you add a warning/error to addEventHandler whenever somebody tries to register a handler for onClientPedsProcessed?

@botder botder added refactor backwards-incompatible Should be merged after the release of 1.6.1 labels Jan 4, 2025
@lynconsix
Copy link
Author

Can you add a warning/error to addEventHandler whenever somebody tries to register a handler for onClientPedsProcessed?

I'll find a way to do it

@tederis
Copy link
Member

tederis commented Jan 5, 2025

This event should be named "onClientPostUpdate". It will describe the meaning of the event better.

Comment on lines 3879 to 3883
if (m_pRootEntity->CallEvent("onClientPedsProcessed", Arguments, false))
{
throw std::runtime_error("'onClientPedsProcessed' is no longer supported, renamed to 'onClientPostUpdate'");
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

The better solution would be to just assume onClientPostUpdate when somebody does addEventHandler("onClientPedsProcessed", ...) but also show a warning.

Comment on lines +3879 to +3883
if (m_pRootEntity->CallEvent("onClientPedsProcessed", Arguments, false))
{
CStaticFunctionDefinitions::AddEventHandler("onClientPedsProcessed", "onClientPostUpdate", "The 'onClientPedsProcessed' event is deprecated and has been renamed to 'onClientPostUpdate'.");
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't know how you came up with the idea to put that here, remove it and adapt CStaticFunctionDefinitions::AddEventHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatible Should be merged after the release of 1.6.1 refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants