mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 00:32:06 +00:00
Buy/sell x buying loop lagging issue fix general shop using fixes trading amount fix (#133)
* Update NpcHandler.class Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it. Still have some issue around objects but that's another story. * Update NpcHandler.java Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it. Still have some issue around objects but that's another story. closes #47 * Buy/Sell-X--Buying-loop-lagging-issue-fix--General-shop-using-fixes--Trading-amount-fix - Added buy/sell X feature - Fixed a lag with the buying loop when buying high amount. Instead of spam buying 1 at a times it divide the amount to buy in equal parts and buy in increments. - Cant remember at all I'll edit after eating.
This commit is contained in:
@@ -22,7 +22,7 @@ public abstract class Player {
|
||||
public ArrayList<String> killedPlayers = new ArrayList<String>();
|
||||
public ArrayList<Integer> attackedPlayers = new ArrayList<Integer>();
|
||||
public ArrayList<String> lastKilledPlayers = new ArrayList<String>();
|
||||
|
||||
|
||||
public int CraftInt, Dcolor, FletchInt, clanId = -1;
|
||||
|
||||
public int[][] barrowCrypt = {
|
||||
@@ -970,32 +970,9 @@ public abstract class Player {
|
||||
wQueueWritePtr = next;
|
||||
// }
|
||||
}
|
||||
|
||||
public boolean goodDistance(int objectX, int objectY, int playerX,
|
||||
int playerY, int distance) {
|
||||
for (int i = 0; i <= distance; i++) {
|
||||
for (int j = 0; j <= distance; j++) {
|
||||
if (objectId == 2282 || objectId == 10883 || objectId == 2322
|
||||
|| objectId == 4493 || objectId == 12164
|
||||
|| objectId == 1721 || objectId == 1722
|
||||
|| objectId == 4304 && playerX == 2619
|
||||
&& playerY == 3667) {
|
||||
return true;
|
||||
}
|
||||
if (objectX + i == playerX
|
||||
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
|
||||
return true;
|
||||
} else if (objectX - i == playerX
|
||||
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
|
||||
return true;
|
||||
} else if (objectX == playerX
|
||||
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean goodDistance(int objectX, int objectY, int playerX, int playerY, int distance) {
|
||||
return ((objectX-playerX <= distance && objectX-playerX >= -distance) && (objectY-playerY <= distance && objectY-playerY >= -distance));
|
||||
}
|
||||
|
||||
public int getNextWalkingDirection() {
|
||||
if (wQueueReadPtr == wQueueWritePtr) {
|
||||
|
||||
Reference in New Issue
Block a user