post your endGame method.
|
Alright guys well recently i've finished adding castlewars and well i've tested it and it all works except for one thing.
Once the game timer reaches 0 all players are supposed to be teleported to the game area but instead their height level goes up and are unable to walk.
I've been trying to fix this for a while now.
post your endGame method.
But the bug happens before the game starts.Code:/* * Method we use to end a single players game. */ public static void endGame() { Iterator<Client> iterator = gameRoom.keySet().iterator(); while (iterator.hasNext()) { Client player = (Client) iterator.next(); if (player == null) { continue; } for (int i = 0; i < 25; i++) { player.playerLevel[i] = player .getLevelForXP(player.playerXP[i]); player.getPA().refreshSkill(i); } player.isDead = false; player.getActionSender().showOption(3, 0, "Null", 1); player.getPA().movePlayer(2440 + Misc.random(3), 3089 - Misc.random(3), 0); player.resetWalkingQueue(); player.sendMessage("You have left the game of Castle Wars."); for (int i = 0; i < 7; i++) { player.getPA().refreshSkill(i); } player.spawnRoomWait = 120; player.getActionSender().createPlayerHints(10, -1); deleteGameItems(player); } }
oh my bad i meant startgame method in there there should be player.getPA().movePlayer(x, y, height); The height is prob set at 1 set it to 0.
That is my startgame method i'll try what you said right now.Code:public static void startGame() { if (getSaraPlayers() < 1 || getZammyPlayers() < 1) { gameStartTimer = GAME_START_TIMER; return; } gameStartTimer = -1; System.out.println("CWars Started."); gameStarted = true; timeRemaining = GAME_TIMER / 2; Iterator iterator = waitingRoom.keySet().iterator(); while (iterator.hasNext()) { Client player = (Client) iterator.next(); int team = waitingRoom.get(player); if (player == null) { continue; } player.getActionSender().walkableInterface(-1); player.getPA().movePlayer(GAME_ROOM[team - 1][0] + Misc.random(3), GAME_ROOM[team - 1][1] - Misc.random(3), 1); player.getPA().movePlayer(GAME_ROOM[team - 1][0] + Misc.random(3), GAME_ROOM[team - 1][1] - Misc.random(3), 1); gameRoom.put(player, team); } waitingRoom.clear(); }
Didn't fix it Scuey.
try thisCode:public static void startGame() { if (getSaraPlayers() < 1 || getZammyPlayers() < 1) { gameStartTimer = GAME_START_TIMER; return; } gameStartTimer = -1; System.out.println("CWars Started."); gameStarted = true; timeRemaining = GAME_TIMER / 2; Iterator iterator = waitingRoom.keySet().iterator(); while (iterator.hasNext()) { Client player = (Client) iterator.next(); int team = waitingRoom.get(player); if (player == null) { continue; } player.getActionSender().walkableInterface(-1); player.getPA().movePlayer(GAME_ROOM[team - 1][0] + Misc.random(3), GAME_ROOM[team - 1][1] - Misc.random(3), 0); gameRoom.put(player, team); } waitingRoom.clear(); }
Fixed it thanks Scuey!
lol np
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |