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

Not working f home on first home creation #123

Merged
merged 1 commit into from
May 13, 2023

Conversation

dadodasyra
Copy link
Contributor

Please make sure your pull request complies with these guidelines:

    • Use same formatting
    • Changes must have been tested on PMMP.
    • Unless it is a minor code modification, you must use an IDE.
    • Have a detailed title.

What does the PR change?

The homeWorld variable is checked when the player does /f home to teleport to his faction home. The thing is that it's always null until the server reboots. So if the faction is new and the home is new the player cannot teleport to it. I don't really understand why homeWorld exists but maybe it's usefull so here is a fix.
There's no real issue opened to it.

Testing Environment

N/A

Extra Information

N/A

The homeWorld variable is checked when the player does /f home to teleport to his faction home. The thing is that it's always null until the server reboots. So if the faction is new and the home is new the player cannot teleport to it.
I don't really understand why homeWorld exists but maybe it's usefull so here is a fix.
@Aericio Aericio requested review from DaPigGuy and Aericio and removed request for DaPigGuy October 20, 2022 21:40
Copy link
Collaborator

@Aericio Aericio left a comment

Choose a reason for hiding this comment

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

I don't really understand why homeWorld exists but maybe it's usefull so here is a fix.

I added it to fix this issue. #72
There was some reason I had to do it like this / didn't know another alternative, but I don't remember.

PR looks fine. Was this tested?

@dadodasyra
Copy link
Contributor Author

In fact Position::$world can be null, the easiest way is to detect if Position::$world is null and it should fix #72.
Btw you should check world after checking if the home exists.

I didn't tried it in game but I dont see why this should not work, I will today if I can.

@Aericio Aericio added this to the 2.0.4 milestone Apr 25, 2023
@Aericio Aericio merged commit 93f195e into DaPigGuy:master May 13, 2023
@dadodasyra dadodasyra deleted the homeWorldFix branch June 18, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants