-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Fix #322: onClientMarkerHit(Leave) ignores element's interior #1661
Conversation
I believe an extra event parameter must be added for backwards compatibility reason, but this is debatable. |
in discord, qaisjp said that we can fix it but without adding new parameter |
@qaisjp What's your idea on backwards compatibility or is this a screw-it issue? |
screw it situation (but maybe we should do this after 1.5.8 so we can watch the effects for longer?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works fine and is technically safe for merging... but I think, reduce confusion, we should only merge this once we've fixed interiors appearing in all dimensions (#601 needs to be reimplemented in a separate PR).
Why have we decided to randomly break backwards compatibility here when a reasonable, alternative solution already exists? I think we should just add |
Yeah, I think a parameter is good for now. |
@@ -399,7 +399,7 @@ void CClientMarker::StreamOut() | |||
|
|||
void CClientMarker::Callback_OnCollision(CClientColShape& Shape, CClientEntity& Entity) | |||
{ | |||
if (IS_PLAYER(&Entity)) | |||
if (IS_PLAYER(&Entity) && GetInterior() == Entity.GetInterior()) // Matching interior? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, let's instead add the matching interior as an extra parameter to onClientMarkerHit call, just like matching dimension.
@@ -411,7 +411,7 @@ void CClientMarker::Callback_OnCollision(CClientColShape& Shape, CClientEntity& | |||
|
|||
void CClientMarker::Callback_OnLeave(CClientColShape& Shape, CClientEntity& Entity) | |||
{ | |||
if (IS_PLAYER(&Entity)) | |||
if (IS_PLAYER(&Entity) && GetInterior() == Entity.GetInterior()) // Matching interior? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, let's instead add the matching interior as an extra parameter to onClientMarkerHit call, just like matching dimension.
This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically. |
This draft pull request was closed because it has been marked stale for 30 days with no activity. |
According to #322 Looks like onClientMarkerHit doesn't care about element's interior and when I checked MTA's code looks like onClientMarkerLeave does the same thing, and for onMakerHit and onMakerLeave they do check for interior.
mtasa-blue/Server/mods/deathmatch/logic/CMarker.cpp
Line 315 in 3b95ff4