Browse Source

added none check to enemy and notEnemy in mobbase

master
FatBoy-DOTC 2 years ago
parent
commit
344c5900b8
  1. 1
      src/engine/Enum.java
  2. 11
      src/engine/objects/MobBase.java

1
src/engine/Enum.java

@ -50,7 +50,6 @@ public class Enum { @@ -50,7 +50,6 @@ public class Enum {
}
public enum MonsterType implements EnumBitSetHelper<MonsterType> {
None,
Aelfborn,
All,
Animal,

11
src/engine/objects/MobBase.java

@ -109,9 +109,14 @@ public class MobBase extends AbstractGameObject { @@ -109,9 +109,14 @@ public class MobBase extends AbstractGameObject {
}
this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), Enum.MobFlagType.class);
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class);
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class);
if(rs.getLong("notEnemy") == 0)
this.notEnemy = EnumBitSet.noneOf(Enum.MonsterType.class);
else
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class);
if(rs.getLong("enemy") == 0)
this.enemy = EnumBitSet.noneOf(Enum.MonsterType.class);
else
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class);
this.seeInvis = rs.getInt("seeInvis");
this.scale = rs.getFloat("scale");

Loading…
Cancel
Save