Refactor various minor things
This commit is contained in:
@@ -1929,8 +1929,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ob instanceof MapItem) {
|
||||
MapItem mapitem = (MapItem) ob;
|
||||
if (ob instanceof MapItem mapitem) {
|
||||
if (System.currentTimeMillis() - mapitem.getDropTime() < 400 || !mapitem.canBePickedBy(this)) {
|
||||
sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
|
||||
@@ -61,8 +61,8 @@ public abstract class AbstractMovementPacketHandler extends AbstractPacketHandle
|
||||
res.add(alm);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 2:
|
||||
case 1: // jump
|
||||
case 2: // knockback
|
||||
case 6: // fj
|
||||
case 12:
|
||||
case 13: // Shot-jump-back thing
|
||||
@@ -79,8 +79,8 @@ public abstract class AbstractMovementPacketHandler extends AbstractPacketHandle
|
||||
res.add(rlm);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
case 4: // tele... -.-
|
||||
case 3: // teleport disappear
|
||||
case 4: // teleport appear
|
||||
case 7: // assaulter
|
||||
case 8: // assassinate
|
||||
case 9: // rush
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class ReactorHitHandler extends AbstractPacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(InPacket p, Client c) {
|
||||
//System.out.println(slea); //To see if there are any differences with packets
|
||||
//CD 00 6B 00 00 00 01 00 00 00 03 00 00 00 20 03 F7 03 00 00
|
||||
//[CD 00] [6B 00 00 00] [01 00 00 00] [03 00] [00 00 20 03] [F7 03 00 00]
|
||||
//[CD 00] [66 00 00 00] [00 00 00 00] [02 00] [00 00 19 01] [00 00 00 00]
|
||||
int oid = p.readInt();
|
||||
int charPos = p.readInt();
|
||||
|
||||
@@ -36,12 +36,14 @@ public final class TouchReactorHandler extends AbstractPacketHandler {
|
||||
public final void handlePacket(InPacket p, Client c) {
|
||||
int oid = p.readInt();
|
||||
Reactor reactor = c.getPlayer().getMap().getReactorByOid(oid);
|
||||
if (reactor != null) {
|
||||
if (p.readByte() != 0) {
|
||||
ReactorScriptManager.getInstance().touch(c, reactor);
|
||||
} else {
|
||||
ReactorScriptManager.getInstance().untouch(c, reactor);
|
||||
}
|
||||
if (reactor == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.readByte() != 0) {
|
||||
ReactorScriptManager.getInstance().touch(c, reactor);
|
||||
} else {
|
||||
ReactorScriptManager.getInstance().untouch(c, reactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +504,9 @@ public class MapleMap {
|
||||
xLimits = bounds;
|
||||
} else {
|
||||
// assuming MINIMAP always have an equal-greater picture representation of the map area (players won't walk beyond the area known by the minimap).
|
||||
Point lp = new Point(mapArea.x, mapArea.y), rp = new Point(mapArea.x + mapArea.width, mapArea.y), fallback = new Point(mapArea.x + (mapArea.width / 2), mapArea.y);
|
||||
Point lp = new Point(mapArea.x, mapArea.y);
|
||||
Point rp = new Point(mapArea.x + mapArea.width, mapArea.y);
|
||||
Point fallback = new Point(mapArea.x + (mapArea.width / 2), mapArea.y);
|
||||
|
||||
lp = bsearchDropPos(lp, fallback); // approximated leftmost fh node position
|
||||
rp = bsearchDropPos(rp, fallback); // approximated rightmost fh node position
|
||||
|
||||
@@ -256,8 +256,8 @@ public class Reactor extends AbstractMapObject {
|
||||
cancelReactorTimeout();
|
||||
attackHit = wHit;
|
||||
|
||||
if (YamlConfig.config.server.USE_DEBUG == true) {
|
||||
c.getPlayer().dropMessage(5, "Hitted REACTOR " + this.getId() + " with POS " + charPos + " , STANCE " + stance + " , SkillID " + skillid + " , STATE " + stats.getType(state) + " STATESIZE " + stats.getStateSize(state));
|
||||
if (YamlConfig.config.server.USE_DEBUG) {
|
||||
c.getPlayer().dropMessage(5, "Hitted REACTOR " + this.getId() + " with POS " + charPos + " , STANCE " + stance + " , SkillID " + skillid + " , STATE " + state + " STATESIZE " + stats.getStateSize(state));
|
||||
}
|
||||
ReactorScriptManager.getInstance().onHit(c, this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user