Browse Source

No some are longs

combat-2
MagicBot 7 months ago
parent
commit
4f115291eb
  1. 4
      src/engine/mbEnums.java
  2. 8
      src/engine/objects/ItemTemplate.java
  3. 4
      src/engine/objects/Mob.java
  4. 6
      src/engine/objects/MobBase.java

4
src/engine/mbEnums.java

@ -44,7 +44,7 @@ public class mbEnums { @@ -44,7 +44,7 @@ public class mbEnums {
return bitvector;
}
public static <E extends java.lang.Enum<E>> EnumSet<E> fromInt(int bitVector, Class<E> enumClass) {
public static <E extends java.lang.Enum<E>> EnumSet<E> fromLong(long bitVector, Class<E> enumClass) {
// Bitvector -> EnumSet without the EnumBitvector dependency
@ -56,7 +56,7 @@ public class mbEnums { @@ -56,7 +56,7 @@ public class mbEnums {
return enumSet;
for (E enumValue : enumClass.getEnumConstants()) {
if ((bitVector & (1 << enumValue.ordinal())) != 0) {
if ((bitVector & (1L << enumValue.ordinal())) != 0) {
enumSet.add(enumValue);
}
}

8
src/engine/objects/ItemTemplate.java

@ -500,13 +500,13 @@ public class ItemTemplate { @@ -500,13 +500,13 @@ public class ItemTemplate {
rune_dsc = jsonObject.getString("rune_dsc");
rune_fx_txt = jsonObject.getString("rune_fx_txt");
int group_tactics_bitvector = jsonObject.getInt("rune_group_tactics");
long group_tactics_bitvector = jsonObject.getLong("rune_group_tactics");
rune_group_tactics.addAll(mbEnums.fromInt(group_tactics_bitvector, mbEnums.MobBehaviourType.class));
rune_group_tactics.addAll(mbEnums.fromLong(group_tactics_bitvector, mbEnums.MobBehaviourType.class));
int group_role_bitvector = jsonObject.getInt("rune_group_role_set");
long group_role_bitvector = jsonObject.getLong("rune_group_role_set");
rune_group_role_set.addAll(mbEnums.fromInt(group_role_bitvector, mbEnums.MobBehaviourType.class));
rune_group_role_set.addAll(mbEnums.fromLong(group_role_bitvector, mbEnums.MobBehaviourType.class));
JSONArray enemy_types_json = jsonObject.getJSONArray("rune_enemy_monster_types");

4
src/engine/objects/Mob.java

@ -143,8 +143,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { @@ -143,8 +143,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
this.runeSet = rs.getInt("runeSet");
this.bootySet = rs.getInt("bootySet");
this.notEnemy = mbEnums.fromInt(rs.getInt("notEnemy"), mbEnums.MonsterType.class);
this.enemy = mbEnums.fromInt(rs.getInt("enemy"), mbEnums.MonsterType.class);
this.notEnemy = mbEnums.fromLong(rs.getLong("notEnemy"), mbEnums.MonsterType.class);
this.enemy = mbEnums.fromLong(rs.getLong("enemy"), mbEnums.MonsterType.class);
this.firstName = rs.getString("mob_name");
if (rs.getString("fsm").length() > 1)

6
src/engine/objects/MobBase.java

@ -77,9 +77,9 @@ public class MobBase extends AbstractGameObject { @@ -77,9 +77,9 @@ public class MobBase extends AbstractGameObject {
this.fsm = mbEnums.MobBehaviourType.valueOf(rs.getString("fsm"));
this.flags = mbEnums.fromInt(rs.getInt("flags"), mbEnums.MobFlagType.class);
this.notEnemy = mbEnums.fromInt(rs.getInt("notEnemy"), mbEnums.MonsterType.class);
this.enemy = mbEnums.fromInt(rs.getInt("enemy"), mbEnums.MonsterType.class);
this.flags = mbEnums.fromLong(rs.getLong("flags"), mbEnums.MobFlagType.class);
this.notEnemy = mbEnums.fromLong(rs.getLong("notEnemy"), mbEnums.MonsterType.class);
this.enemy = mbEnums.fromLong(rs.getLong("enemy"), mbEnums.MonsterType.class);
this.seeInvis = rs.getInt("seeInvis");
this.scale = rs.getFloat("scale");

Loading…
Cancel
Save