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

Use 2D distance to check whether team members have arrived destination #1487

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

CrimRecya
Copy link
Contributor

  • Now the team members use the 2D distance instead of the 3D distance to judge whether to reach the mission destination, so as to prevent the problem that the mission is stuck and cannot continue in some cases (such as when the jumpjet stops on the building).

Copy link

github-actions bot commented Jan 5, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@NetsuNegi
Copy link
Contributor

The game has it's own DistanceFrom2D function, see 0x5F6440.
Maybe you can just redirect to that function.

@CrimRecya
Copy link
Contributor Author

The game has it's own DistanceFrom2D function, see 0x5F6440. Maybe you can just redirect to that function.

Thank you for reminding me. But I found that this fix affect the aircraft, so I decided to specialize it.

src/Misc/Hooks.BugFixes.cpp Outdated Show resolved Hide resolved
src/Misc/Hooks.BugFixes.cpp Outdated Show resolved Hide resolved
@Metadorius Metadorius self-assigned this Jan 8, 2025
src/Misc/Hooks.BugFixes.cpp Outdated Show resolved Hide resolved

int __fastcall Check2DDistanceInsteadOf3D(ObjectClass* pSource, void* _, AbstractClass* pTarget)
{
return (pSource->IsInAir() && pSource->WhatAmI() != AbstractType::Aircraft) // Jumpjets or sth in the air
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you omit AircraftClass? Also does all the in air stuff need to be considered like so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At present, it seems that aircrafts use their own mapcoords and the team destination's mapcoords to check.
During the previous test, it was found that if the aircraft uses this and needs to return to the airport with the script first, it will interrupt the remaining tasks for unknown reasons.

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.

4 participants