Skip to content

Commit

Permalink
Fix index
Browse files Browse the repository at this point in the history
I was using Array::indexOf rather than using the index in the for loop...whoops
  • Loading branch information
team1257Simon authored Jul 28, 2016
1 parent 5c84577 commit be1a11f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ exports.commands = {
let message = room.log[i];
let split = message.split("|");
if (Users.get(split[3]) === this.targetUser || Users.get(split[3]).getAltUsers().indexOf(this.targetUser) >= 0) {
room.log.splice(room.log.indexOf(message), 1);
room.log.splice(i, 1);
}
}
this.addModCommand("" + targetUser.name + "'s messages were deleted from the log in room " + room.id + " by " + user.name + ".");
Expand Down

0 comments on commit be1a11f

Please sign in to comment.