I saw someone who requested this and decided to add it myself since it's a cool feature.
The RS client will always draw your own player first.
What this does is basically draw the player you're interacting with (following, fighting, etc) after yours.
This will make it "prioritized" and shown on the top in a stack of players.
What you're adding:
Players you are fighting/following/interacting with will always be drawn on top when multiple players are standing in the same tile.
Locate this piece of code:
(showOtherPlayers is probably called method47 if your client isn't refactored)
And change it to the following:
Code:
private void moveCameraWithPlayer() {
anInt1265++;
showPrioritizedPlayers();
showNPCs(true);
showOtherPlayers();
And then add the following methods:
Code:
private void showPrioritizedPlayers() {
showPlayer(localPlayer, internalLocalPlayerIndex << 14, true);
//Draw the player we're interacting with
//Interacting includes combat, following, etc.
int interact = localPlayer.interactingEntity - 32768;
if(interact > 0) {
Player player = players[interact];
showPlayer(player, interact << 14, false);
}
}
private void showOtherPlayers() {
for (int l = 0; l < playerCount; l++) {
Player player = players[playerList[l]];
int index = playerList[l] << 14;
//Don't draw interacting player as we've already drawn it on top
int interact_index = (localPlayer.interactingEntity - 32768);
if(interact_index > 0 && index == interact_index << 14) {
continue;
}
if(!showPlayer(player, index, false)) {
continue;
}
}
}
private boolean showPlayer(Player player, int i1, boolean flag) {
if (player == null || !player.isVisible()) {
return false;
}
player.aBoolean1699 = (lowMemory && playerCount > 50 || playerCount > 200) && !flag && player.movementAnimation == player.idleAnimation;
int j1 = player.x >> 7;
int k1 = player.y >> 7;
if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104) {
return false;
}
if (player.playerModel != null && tick >= player.objectModelStart && tick < player.objectModelStop) {
player.aBoolean1699 = false;
player.anInt1709 = getCenterHeight(plane, player.y, player.x);
scene.addToScenePlayerAsObject(plane, player.y, player, player.orientation, player.objectAnInt1722GreaterYLoc, player.x, player.anInt1709, player.objectAnInt1719LesserXLoc, player.objectAnInt1721GreaterXLoc, i1, player.objectAnInt1720LesserYLoc);
return false;
}
if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
if (anIntArrayArray929[j1][k1] == anInt1265) {
return false;
}
anIntArrayArray929[j1][k1] = anInt1265;
}
player.anInt1709 = getCenterHeight(plane, player.y, player.x);
scene.addAnimableA(plane, player.orientation, player.anInt1709, i1, player.y, 60, player.x, player, player.animationStretches);
return true;
}
Note: The showPlayer method is a slightly modified version of method47 (showOtherPlayers). If you receive errors, simply look at method47 (showOtherPlayers) and copy the fields from there.
You can remove method47 (showOtherPlayers) after adding this.