Fix issues regarding entity movement methods #702
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main issue fixed:
Entity#move
still returnedtrue
even when not moved as either x or y delta is zero. The boolean result should indicate whether the entity is moved (false
whenever completely not moved), when any non-zero argument is passed. (This issue was found when doing #592)Furthermore, the line
was kept just because the original method contains the check, but was for when both x and y delta are zero. The code is then checked somehow to be logically incorrect, and the actual logically correct line already exists in
#move
asMinor (potential) issues in
FireSpark
(mostly fixed):Entity#x
andEntity#y
used in#moveX
and#moveY
were not taken into account when calculating distance of movement, which may lead to potential increasing gap between "real coordinates" and "virutal coordinates".#move
is not called, which may lead to inconsistent operations between overriding code and original method.#move
depends on integral real coordinates, it would still return as "not moved" when the movement (from virtual double coordinates) made less than a unit/"pixel" of movement (no "movement" in integral floored coordinates), leading to unexpected result. However, at the moment, no obvious impact is found.