mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-06 16:49:07 +00:00
fixup close shop, re-open shop
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package redone.game.bots;
|
package redone.game.bots;
|
||||||
|
|
||||||
|
import io.netty.util.Timeout;
|
||||||
import redone.Constants;
|
import redone.Constants;
|
||||||
import redone.game.players.Client;
|
import redone.game.players.Client;
|
||||||
import redone.game.players.PlayerHandler;
|
import redone.game.players.PlayerHandler;
|
||||||
@@ -105,15 +106,24 @@ public class BotHandler
|
|||||||
public static void closeShop(Client player) {
|
public static void closeShop(Client player) {
|
||||||
Client shop = getPlayerShop(player);
|
Client shop = getPlayerShop(player);
|
||||||
if (shop == null) return;
|
if (shop == null) return;
|
||||||
shop.disconnected = true;
|
shop.getPlayerAssistant().movePlayer(0,0,0);
|
||||||
shop.logout(true);
|
new Thread(() -> {
|
||||||
for (int index = 0; index < botList.size(); index++){
|
try {
|
||||||
if (botList.get(index).getBotClient().properName.equalsIgnoreCase(player.properName)) {
|
Thread.sleep(500);
|
||||||
botList.remove(index);
|
shop.disconnected = true;
|
||||||
return;
|
shop.logout(true);
|
||||||
|
for (int index = 0; index < botList.size(); index++){
|
||||||
|
if (botList.get(index).getBotClient().properName.equalsIgnoreCase(player.properName)) {
|
||||||
|
botList.remove(index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
index++;
|
catch (Exception e){
|
||||||
}
|
System.err.println(e);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addCoins(int shop_id, int amount){
|
public static void addCoins(int shop_id, int amount){
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user