Browse Source

Flag testing

combat-2
MagicBot 8 months ago
parent
commit
d55b57f7d0
  1. 10
      src/engine/mbEnums.java
  2. 10
      src/engine/net/client/msg/ManageNPCMsg.java

10
src/engine/mbEnums.java

@ -37,6 +37,16 @@ import java.util.concurrent.ThreadLocalRandom;
public class mbEnums { public class mbEnums {
public static <T extends Enum<T>> int toInt(EnumSet<T> enumSet) {
int bitvector = 0;
for (T value : enumSet)
bitvector |= 1 << value.ordinal();
return bitvector;
}
public static <T extends Enum<T>> long toLong(EnumSet<T> enumSet) { public static <T extends Enum<T>> long toLong(EnumSet<T> enumSet) {
long bitvector = 0L; long bitvector = 0L;

10
src/engine/net/client/msg/ManageNPCMsg.java

@ -10,6 +10,7 @@
package engine.net.client.msg; package engine.net.client.msg;
import engine.gameManager.NPCManager; import engine.gameManager.NPCManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.mbEnums.MinionType; import engine.mbEnums.MinionType;
import engine.mbEnums.ProtectionState; import engine.mbEnums.ProtectionState;
@ -456,10 +457,11 @@ public class ManageNPCMsg extends ClientNetMsg {
else else
writer.put((byte) 0); writer.put((byte) 0);
if ((item.prefixToken == 0 && item.suffixToken == 0)) writer.putInt(mbEnums.toInt(item.flags));
writer.putInt(0); // if ((item.prefixToken == 0 && item.suffixToken == 0))
else // writer.putInt(0);
writer.putInt(-1497023830); // else
// writer.putInt(-1497023830);
writer.putInt(item.prefixToken); writer.putInt(item.prefixToken);
writer.putInt(item.suffixToken); writer.putInt(item.suffixToken);

Loading…
Cancel
Save