Skip to content
Permalink
Browse files
Check for associative array usage in spawn_particle
Fixes #1210
  • Loading branch information
LadyCailin committed Jun 13, 2020
1 parent 726dd6a commit ca0531dca3ff17662487c6fc39103bd68176ffcf
Showing 1 changed file with 6 additions and 2 deletions.
@@ -1657,8 +1657,12 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment enviro
try {
if(args.length == 3) {
MCPlayer player;
if(args[2].isInstanceOf(CArray.TYPE)) {
for(Mixed playerName : ((CArray) args[2]).asList()) {
if(args[2] instanceof CArray) {
CArray players = (CArray) args[2];
if(players.isAssociative()) {
throw new CREIllegalArgumentException("Players argument must be a normal array.", t);
}
for(Mixed playerName : players.asList()) {
player = Static.GetPlayer(playerName, t);
player.spawnParticle(l, p, count, offsetX, offsetY, offsetZ, speed, data);
}

0 comments on commit ca0531d

Please sign in to comment.