Swapped from list to set to prevent duplicates

Use a set instead, clone instead of adding directly to the list.
This commit is contained in:
James McDowell
2021-05-20 19:16:22 +10:00
parent 0345ce844e
commit 9128329d37
3 changed files with 6 additions and 4 deletions

View File

@@ -8326,7 +8326,7 @@ public class MaplePacketCreator {
* @param scriptableNpcIds Ids of npcs to enable scripts for.
* @return a packet which makes the npc's provided scriptable.
*/
public static byte[] setNPCScriptable(List<Integer> scriptableNpcIds) { // thanks to GabrielSin
public static byte[] setNPCScriptable(Set<Integer> scriptableNpcIds) { // thanks to GabrielSin
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.SET_NPC_SCRIPTABLE.getValue());
mplew.write(scriptableNpcIds.size());