plushmonkey / JedCore

JedCore Addon for ProjectKorra
12 stars 15 forks source link

FireComet region check #15

Closed Hetag1216 closed 5 years ago

Hetag1216 commented 6 years ago
plushmonkey commented 6 years ago

This isn't quite correct. This would leave partial and inconsistent blasts depending on the direction of the projectile.

The getCircle method always returns the list of locations in the negative to positive directions for the x and z axes. This means the blast loop starts at the absolute negative x and z of the blast. If those are unbreakable or in the protected region, then it would exit the blast early, leaving all of the blocks that should have been blown up unaffected. In another case, it could explode on an unbreakable block from the positive side and only the back side would blow up.

If the goal is to prevent the blast rather than exploding upon entering protected regions, then the check should happen before blast even starts. The best place would be before the advance() call in the main loop. Nothing in the blast loop should cause it to return early.

Hetag1216 commented 6 years ago

That was pretty clear, thanks for the explaination. I just tried to call the region check before the advance() but it seems to be the same exact thing, just wanted to contribute to the project!

SoraShiunin commented 6 years ago

How would you go on about to put this in the plugin. Im a github noob and still have problems with firecomet blowing up stuff.

plushmonkey commented 6 years ago

You would add his repository as a remote repo in your local repo, pull his changes into a local branch, merge into your branch if you have other changes, then build it. Alternatively, you can just clone his fork locally, and then build it.

However, like I said above, it doesn't really solve the problem. This pull request changed it to remove itself when it comes in contact with a protected region instead of blowing up. Someone could still aim it at the ground in front of the protected region, and it would blow up on the other side of the protected region if it's too thin. This is true for almost every bending ability.

The problem could be fixed with raycasts and bounding box intersections, but it's really unnecessary work because most abilities don't do that. Your protected regions should always cover what you want protected, not just a thin wall that's trying to act as a barrier.