-
-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix entity casting issue and add regression test. (#6614)
- Loading branch information
Showing
3 changed files
with
82 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/test/skript/tests/regressions/6612-nearest entity cast error.sk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
test "charge creeper nearest entity cast": | ||
set {_location} to spawn of world "world" | ||
spawn a creeper at {_location} | ||
set {_creeper} to last spawned creeper | ||
assert {_creeper} is not charged with "spawning a normal creeper shouldn't spawn a charged one" | ||
make (nearest creeper to {_location}) charged # this used to throw an exception | ||
assert {_creeper} is charged with "a creeper should be charged after it is set as charged" | ||
uncharge the nearest creeper to {_location} # this would also throw an exception | ||
assert {_creeper} is not charged with "uncharging a charged creeper should uncharge it" | ||
delete the last spawned creeper | ||
|
||
test "poison nearest entity cast": | ||
set {_location} to spawn of world "world" | ||
spawn a creeper at {_location} | ||
set {_creeper} to last spawned creeper | ||
poison (nearest entity to {_location}) # this never threw an exception | ||
poison (nearest creeper to {_location}) # this used to throw an exception | ||
delete the last spawned creeper |