Fixed doors getting stuck "in use"
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package core.game.content.global.action;
|
package core.game.content.global.action;
|
||||||
|
|
||||||
|
import api.ContentAPIKt;
|
||||||
import core.game.node.entity.Entity;
|
import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.entity.player.link.audio.Audio;
|
import core.game.node.entity.player.link.audio.Audio;
|
||||||
@@ -98,16 +99,11 @@ public final class DoorActionHandler {
|
|||||||
entity.lock(4);
|
entity.lock(4);
|
||||||
final Location loc = entity.getLocation();
|
final Location loc = entity.getLocation();
|
||||||
entity.addExtension(LogoutTask.class, new LocationLogoutTask(4, loc));
|
entity.addExtension(LogoutTask.class, new LocationLogoutTask(4, loc));
|
||||||
object.setCharge(IN_USE_CHARGE);
|
|
||||||
if (second != null) {
|
|
||||||
second.setCharge(IN_USE_CHARGE);
|
|
||||||
}
|
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
((Player) entity).getAudioManager().send(new Audio(3419));
|
((Player) entity).getAudioManager().send(new Audio(3419));
|
||||||
}
|
}
|
||||||
GameWorld.getPulser().submit(new Pulse(1) {
|
GameWorld.getPulser().submit(new Pulse(1) {
|
||||||
boolean opened = false;
|
boolean opened = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
if (!opened) {
|
if (!opened) {
|
||||||
@@ -115,11 +111,13 @@ public final class DoorActionHandler {
|
|||||||
entity.getWalkingQueue().reset();
|
entity.getWalkingQueue().reset();
|
||||||
entity.getWalkingQueue().addPath(endLocation.getX(), endLocation.getY());
|
entity.getWalkingQueue().addPath(endLocation.getX(), endLocation.getY());
|
||||||
opened = true;
|
opened = true;
|
||||||
return false;
|
|
||||||
}
|
// Set the door in_use
|
||||||
object.setCharge(1000);
|
object.setCharge(IN_USE_CHARGE);
|
||||||
if (second != null) {
|
if (second != null) {
|
||||||
second.setCharge(1000);
|
second.setCharge(IN_USE_CHARGE);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
Player player = entity.asPlayer();
|
Player player = entity.asPlayer();
|
||||||
@@ -137,6 +135,12 @@ public final class DoorActionHandler {
|
|||||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 1, 6);
|
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 1, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset door to inactive
|
||||||
|
object.setCharge(1000);
|
||||||
|
if (second != null) {
|
||||||
|
second.setCharge(1000);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -83,12 +83,9 @@ public final class EdgevilleNodePlugin extends OptionHandler {
|
|||||||
if (option.equalsIgnoreCase("open") && player.getLocation().getY() < 9918) {
|
if (option.equalsIgnoreCase("open") && player.getLocation().getY() < 9918) {
|
||||||
player.getInterfaceManager().openComponent(382);
|
player.getInterfaceManager().openComponent(382);
|
||||||
player.setAttribute("wildy_gate", node);
|
player.setAttribute("wildy_gate", node);
|
||||||
player.setAttribute("wildy_gate_loc",
|
|
||||||
Location.create(player.getLocation().getX(),player.getLocation().getY()+1));
|
|
||||||
}
|
}
|
||||||
else{ // Leaving the wilderness
|
else{ // Leaving the wilderness
|
||||||
DoorActionHandler.handleAutowalkDoor(player, (Scenery) node,
|
DoorActionHandler.handleAutowalkDoor(player, (Scenery) node);
|
||||||
Location.create(player.getLocation().getX(),player.getLocation().getY()-1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+1
-5
@@ -74,13 +74,9 @@ public final class WildernessInterfacePlugin extends ComponentPlugin {
|
|||||||
}
|
}
|
||||||
public static void handleGate(final Player player){
|
public static void handleGate(final Player player){
|
||||||
Scenery gate = player.getAttribute("wildy_gate");
|
Scenery gate = player.getAttribute("wildy_gate");
|
||||||
Location endLocation = player.getAttribute("wildy_gate_loc");
|
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
player.removeAttribute("wildy_gate");
|
player.removeAttribute("wildy_gate");
|
||||||
player.removeAttribute("wildy_gate_loc");
|
|
||||||
|
|
||||||
// Move player through gate/door
|
// Move player through gate/door
|
||||||
DoorActionHandler.handleAutowalkDoor(player,gate,endLocation);
|
DoorActionHandler.handleAutowalkDoor(player,gate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user