PiggyFactions icon indicating copy to clipboard operation
PiggyFactions copied to clipboard

Not working f home on first home creation

Open dadodasyra opened this issue 2 years ago • 1 comments

Please make sure your pull request complies with these guidelines:

    • [X] Use same formatting
    • [ ] Changes must have been tested on PMMP.
    • [X] Unless it is a minor code modification, you must use an IDE.
    • [X] 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

dadodasyra avatar Oct 20 '22 21:10 dadodasyra

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.

dadodasyra avatar Oct 22 '22 13:10 dadodasyra