mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 08:39:05 +00:00
Random stuff 3 (#308)
* Make ::update automatically restart server as well
* Add bank area checks back since previously you could open a bank, and as long as you didn't open another interface you could abuse it
* Fix noclip (NEEDS TESTING)
* Revert "Fix noclip (#302)"
This reverts commit 521ae52e4c.
* ::clip command removed, fixed a typo, reordered some stuff, fixed a bug with others cannon
-Removed the clip command from the client;
-Fixed a typo in a dialogue;
-Fixed mud battlestaff nto working as runes (water and earth);
-Fixed a bug with other cannons near you preventing you from setting down a cannon. Somehow your player would glitch himself and make it impossible to spawn a cannon at certain spot;
* Snow improvement
Nothing major
* Fixed Click to teleport command
Fixed Click to teleport command;
* cleaned stuff
Co-authored-by: Daniel Ginovker <dcress01@uoguelph.ca>
This commit is contained in:
@@ -161,35 +161,49 @@ public class Walking implements PacketType {
|
||||
packetSize -= 14;
|
||||
}
|
||||
|
||||
int steps = (packetSize - 5) / 2;
|
||||
player.getNewWalkCmdX()[0] = player.getNewWalkCmdY()[0] = 0;
|
||||
|
||||
int[][] path = new int[steps][2];
|
||||
int firstStepX = player.getInStream().readSignedWordBigEndianA();
|
||||
for (int i = 0; i < steps; i++) {
|
||||
path[i][0] = player.getInStream().readSignedByte();
|
||||
path[i][1] = player.getInStream().readSignedByte();
|
||||
}
|
||||
int firstStepY = player.getInStream().readSignedWordBigEndian();
|
||||
int x = firstStepX;
|
||||
int y = firstStepY;
|
||||
player.setNewWalkCmdIsRunning(player.isRunning2 && player.playerEnergy > 0);
|
||||
for (int i = 0; i < steps; i++) {
|
||||
path[i][0] += firstStepX;
|
||||
path[i][1] += firstStepY;
|
||||
x = path[i][0];
|
||||
y = path[i][1];
|
||||
}
|
||||
|
||||
if (!player.clickToTele) {
|
||||
if (player.distanceToPoint(x, y) > 30) {
|
||||
if (player.clickToTele) {
|
||||
player.newWalkCmdSteps = (packetSize - 5) / 2;
|
||||
if (++player.newWalkCmdSteps > player.walkingQueueSize) {
|
||||
player.newWalkCmdSteps = 0;
|
||||
return;
|
||||
}
|
||||
player.getNewWalkCmdX()[0] = player.getNewWalkCmdY()[0] = 0;
|
||||
int firstStepX, firstStepY;
|
||||
firstStepX = player.getInStream().readSignedWordBigEndianA();
|
||||
for (int i = 1; i < player.newWalkCmdSteps; i++) {
|
||||
player.getNewWalkCmdX()[i] = player.getInStream().readSignedByte();
|
||||
player.getNewWalkCmdY()[i] = player.getInStream().readSignedByte();
|
||||
}
|
||||
firstStepY = player.getInStream().readSignedWordBigEndian();
|
||||
player.setNewWalkCmdIsRunning(player.getInStream().readSignedByteC() == 1 && player.playerEnergy > 0);
|
||||
for (int i1 = 0; i1 < player.newWalkCmdSteps; i1++) {
|
||||
player.getPlayerAssistant().movePlayer(player.getNewWalkCmdX()[i1] + firstStepX, player.getNewWalkCmdY()[i1] + firstStepY, player.heightLevel);
|
||||
player.getNewWalkCmdX()[i1] += firstStepX;
|
||||
player.getNewWalkCmdY()[i1] += firstStepY;
|
||||
}
|
||||
}
|
||||
//System.out.println("Player has requested to walk to: "+x+","+y);
|
||||
player.getPlayerAssistant().playerWalk(x, y);
|
||||
|
||||
else {
|
||||
player.getNewWalkCmdX()[0] = player.getNewWalkCmdY()[0] = 0;
|
||||
int steps = (packetSize - 5) / 2;
|
||||
|
||||
int[][] path = new int[steps][2];
|
||||
int firstStepX = player.getInStream().readSignedWordBigEndianA();
|
||||
for (int i = 0; i < steps; i++) {
|
||||
path[i][0] = player.getInStream().readSignedByte();
|
||||
path[i][1] = player.getInStream().readSignedByte();
|
||||
}
|
||||
int firstStepY = player.getInStream().readSignedWordBigEndian();
|
||||
int x = firstStepX;
|
||||
int y = firstStepY;
|
||||
player.setNewWalkCmdIsRunning(player.isRunning2 && player.playerEnergy > 0);
|
||||
for (int i = 0; i < steps; i++) {
|
||||
path[i][0] += firstStepX;
|
||||
path[i][1] += firstStepY;
|
||||
x = path[i][0];
|
||||
y = path[i][1];
|
||||
}
|
||||
//System.out.println("Player has requested to walk to: "+x+","+y);
|
||||
player.getPlayerAssistant().playerWalk(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user