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. 7
      src/engine/objects/MobBase.java

1
src/engine/Enum.java

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

7
src/engine/objects/MobBase.java

@ -109,8 +109,13 @@ public class MobBase extends AbstractGameObject {
} }
this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), Enum.MobFlagType.class); this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), Enum.MobFlagType.class);
if(rs.getLong("notEnemy") == 0)
this.notEnemy = EnumBitSet.noneOf(Enum.MonsterType.class);
else
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class); 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.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class);
this.seeInvis = rs.getInt("seeInvis"); this.seeInvis = rs.getInt("seeInvis");

Loading…
Cancel
Save