A server software implementation, ineroperable with a certain anime game client. The code in this repository is fully custom made for edyoucational purposes and future preservation, no copyrighted code is allowed in this repository.
Entities spawning inside of regions caused the regions to trigger. This was particularly bad in the chasm where paimon give some tips about babbling rocks. the region is in group 166001385, and it is triggered by a mushroom in group 166001308.
There are other affected groups. groups where you are supposed to follow a trail of gadgets, but the regions centered on those gadgets are triggered by the gadgets!
The old definitions of leaving and entering a region used to roughly be:
If something is inside a region and it had not been marked as inside the region in the previous tick, trigger enter region.
If something was marked as inside a region and now is outside the region, trigger leave region.
As an edge case, this triggered enter region when an entity spawns inside a region, or a region spawns around and entity.
I have redefined it as follows:
If something was marked outside a region and moved into a region, trigger enter region.
If something was marked inside a region and moved outside a region, trigger leave region.
Basically, I have made the definitions of enter region and leave region symmetrical.
By request, I have tacked on code that regions can only be triggered by avatars. This renders all of the above moot. :/
[x] Bug fix
[ ] New feature
[ ] Enhancement
[ ] Documentation
Checklist:
[x] My code follows the style guidelines of this project
[x] My pull request is unique and no other pull requests have been opened for these changes
Description
Entities spawning inside of regions caused the regions to trigger. This was particularly bad in the chasm where paimon give some tips about babbling rocks. the region is in group 166001385, and it is triggered by a mushroom in group 166001308. There are other affected groups. groups where you are supposed to follow a trail of gadgets, but the regions centered on those gadgets are triggered by the gadgets!
The old definitions of leaving and entering a region used to roughly be: If something is inside a region and it had not been marked as inside the region in the previous tick, trigger enter region. If something was marked as inside a region and now is outside the region, trigger leave region.
As an edge case, this triggered enter region when an entity spawns inside a region, or a region spawns around and entity.
I have redefined it as follows: If something was marked outside a region and moved into a region, trigger enter region. If something was marked inside a region and moved outside a region, trigger leave region.
Basically, I have made the definitions of enter region and leave region symmetrical.
By request, I have tacked on code that regions can only be triggered by avatars. This renders all of the above moot. :/
Checklist: