Fixed castle doors not been destroyed.

This commit is contained in:
MobiusDev
2016-12-11 15:56:29 +00:00
parent 27dd07c71a
commit 0fb6404282
2 changed files with 8 additions and 1 deletions

View File

@@ -239,6 +239,10 @@ public final class L2DoorInstance extends L2Character
public int getDamage() public int getDamage()
{ {
if (getCastle() == null)
{
return 0;
}
final int dmg = 6 - (int) Math.ceil((getCurrentHp() / getMaxHp()) * 6); final int dmg = 6 - (int) Math.ceil((getCurrentHp() / getMaxHp()) * 6);
if (dmg > 6) if (dmg > 6)
{ {

View File

@@ -36,6 +36,7 @@ public class StaticObject implements IClientOutgoingPacket
private final int _maxHp; private final int _maxHp;
private final int _currentHp; private final int _currentHp;
private final boolean _showHp; private final boolean _showHp;
private final int _damageGrade;
public StaticObject(L2StaticObjectInstance staticObject) public StaticObject(L2StaticObjectInstance staticObject)
{ {
@@ -49,6 +50,7 @@ public class StaticObject implements IClientOutgoingPacket
_maxHp = 0; _maxHp = 0;
_currentHp = 0; _currentHp = 0;
_showHp = false; _showHp = false;
_damageGrade = 0;
} }
public StaticObject(L2DoorInstance door, boolean targetable) public StaticObject(L2DoorInstance door, boolean targetable)
@@ -63,6 +65,7 @@ public class StaticObject implements IClientOutgoingPacket
_maxHp = door.getMaxHp(); _maxHp = door.getMaxHp();
_currentHp = (int) door.getCurrentHp(); _currentHp = (int) door.getCurrentHp();
_showHp = door.getIsShowHp(); _showHp = door.getIsShowHp();
_damageGrade = door.getDamage();
} }
@Override @Override
@@ -80,7 +83,7 @@ public class StaticObject implements IClientOutgoingPacket
packet.writeD(_currentHp); packet.writeD(_currentHp);
packet.writeD(_maxHp); packet.writeD(_maxHp);
packet.writeD(_showHp ? 1 : 0); packet.writeD(_showHp ? 1 : 0);
packet.writeD(0x00); packet.writeD(_damageGrade);
return true; return true;
} }
} }