Skip to content

Commit 2015170

Browse files
committed
chore: Updated SeqType property names
Taken from OS 216 function names Left/right hand replacements were flipped unintentionally before
1 parent b944e58 commit 2015170

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

src/main/java/jagex2/client/Client.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5244,7 +5244,7 @@ public final void updateSequences(ClientEntity e) {
52445244
}
52455245

52465246
if (e.primarySeqFrame >= seq.frameCount) {
5247-
e.primarySeqFrame -= seq.replayoff;
5247+
e.primarySeqFrame -= seq.loops;
52485248
e.primarySeqLoop++;
52495249

52505250
if (e.primarySeqLoop >= seq.replaycount) {
@@ -9158,7 +9158,7 @@ public final void getPlayerExtendedInfo(int mask, Packet buf, int index, ClientP
91589158

91599159
int delay = buf.g1();
91609160
if (player.primarySeqId == seqId && seqId != -1) {
9161-
int replaceMode = SeqType.types[seqId].restart_mode;
9161+
int replaceMode = SeqType.types[seqId].duplicatebehavior;
91629162

91639163
if (replaceMode == 1) {
91649164
player.primarySeqFrame = 0;
@@ -9479,7 +9479,7 @@ public final void getNpcPosExtended(Packet buf, int size) {
94799479
int delay = buf.g1();
94809480

94819481
if (npc.primarySeqId == seqId && seqId != -1) {
9482-
int restartMode = SeqType.types[seqId].restart_mode;
9482+
int restartMode = SeqType.types[seqId].duplicatebehavior;
94839483

94849484
if (restartMode == 1) {
94859485
npc.primarySeqFrame = 0;
@@ -11330,7 +11330,7 @@ public final boolean updateInterfaceAnimation(int delta, int id) {
1133011330
child.seqFrame++;
1133111331

1133211332
if (child.seqFrame >= seq.frameCount) {
11333-
child.seqFrame -= seq.replayoff;
11333+
child.seqFrame -= seq.loops;
1133411334

1133511335
if (child.seqFrame < 0 || child.seqFrame >= seq.frameCount) {
1133611336
child.seqFrame = 0;

src/main/java/jagex2/config/SeqType.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class SeqType {
2727
public int[] delay;
2828

2929
@ObfuscatedName("nc.i")
30-
public int replayoff = -1;
30+
public int loops = -1;
3131

3232
@ObfuscatedName("nc.j")
3333
public int[] walkmerge;
@@ -39,10 +39,10 @@ public class SeqType {
3939
public int priority = 5;
4040

4141
@ObfuscatedName("nc.m")
42-
public int righthand = -1;
42+
public int replaceheldleft = -1;
4343

4444
@ObfuscatedName("nc.n")
45-
public int lefthand = -1;
45+
public int replaceheldright = -1;
4646

4747
@ObfuscatedName("nc.o")
4848
public int replaycount = 99;
@@ -54,7 +54,7 @@ public class SeqType {
5454
public int postanim_mode = -1;
5555

5656
@ObfuscatedName("nc.r")
57-
public int restart_mode;
57+
public int duplicatebehavior;
5858

5959
@ObfuscatedName("nc.a(Lyb;B)V")
6060
public static void unpack(Jagfile config) {
@@ -150,7 +150,7 @@ public void decode(Packet buf) {
150150
this.delay[i] = buf.g2();
151151
}
152152
} else if (code == 2) {
153-
this.replayoff = buf.g2();
153+
this.loops = buf.g2();
154154
} else if (code == 3) {
155155
int count = buf.g1();
156156
this.walkmerge = new int[count + 1];
@@ -165,17 +165,17 @@ public void decode(Packet buf) {
165165
} else if (code == 5) {
166166
this.priority = buf.g1();
167167
} else if (code == 6) {
168-
this.righthand = buf.g2();
168+
this.replaceheldleft = buf.g2();
169169
} else if (code == 7) {
170-
this.lefthand = buf.g2();
170+
this.replaceheldright = buf.g2();
171171
} else if (code == 8) {
172172
this.replaycount = buf.g1();
173173
} else if (code == 9) {
174174
this.preanim_move = buf.g1();
175175
} else if (code == 10) {
176176
this.postanim_mode = buf.g1();
177177
} else if (code == 11) {
178-
this.restart_mode = buf.g1();
178+
this.duplicatebehavior = buf.g1();
179179
} else {
180180
System.out.println("Error unrecognised seq config code: " + code);
181181
}

src/main/java/jagex2/dash3d/ClientLocAnim.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ClientLocAnim(int heightmapNW, int heightmapNE, int heightmapSW, int shap
5151
this.seqFrame = 0;
5252
this.seqCycle = Client.loopCycle;
5353

54-
if (randomFrame && this.seq.replayoff != -1) {
54+
if (randomFrame && this.seq.loops != -1) {
5555
this.seqFrame = (int) (Math.random() * (double) this.seq.frameCount);
5656
this.seqCycle -= (int) (Math.random() * (double) this.seq.getFrameDuration(this.seqFrame));
5757
}
@@ -61,7 +61,7 @@ public ClientLocAnim(int heightmapNW, int heightmapNE, int heightmapSW, int shap
6161
public final Model getModel() {
6262
if (this.seq != null) {
6363
int delta = Client.loopCycle - this.seqCycle;
64-
if (delta > 100 && this.seq.replayoff > 0) {
64+
if (delta > 100 && this.seq.loops > 0) {
6565
delta = 100;
6666
}
6767

@@ -73,7 +73,7 @@ public final Model getModel() {
7373
continue;
7474
}
7575

76-
this.seqFrame -= this.seq.replayoff;
76+
this.seqFrame -= this.seq.loops;
7777

7878
if (this.seqFrame < 0 || this.seqFrame >= this.seq.frameCount) {
7979
this.seq = null;

src/main/java/jagex2/dash3d/ClientPlayer.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ public final Model getAnimatedModel() {
256256
long hash = this.hash;
257257
int primaryTransformId = -1;
258258
int secondaryTransformId = -1;
259-
int rightHandValue = -1;
260259
int leftHandValue = -1;
260+
int rightHandValue = -1;
261261

262262
if (super.primarySeqId >= 0 && super.primarySeqDelay == 0) {
263263
SeqType seq = SeqType.types[super.primarySeqId];
@@ -268,14 +268,14 @@ public final Model getAnimatedModel() {
268268
secondaryTransformId = SeqType.types[super.secondarySeqId].frames[super.secondarySeqFrame];
269269
}
270270

271-
if (seq.righthand >= 0) {
272-
rightHandValue = seq.righthand;
273-
hash += rightHandValue - this.appearance[5] << 40;
271+
if (seq.replaceheldleft >= 0) {
272+
leftHandValue = seq.replaceheldleft;
273+
hash += leftHandValue - this.appearance[5] << 40;
274274
}
275275

276-
if (seq.lefthand >= 0) {
277-
leftHandValue = seq.lefthand;
278-
hash += leftHandValue - this.appearance[3] << 48;
276+
if (seq.replaceheldright >= 0) {
277+
rightHandValue = seq.replaceheldright;
278+
hash += rightHandValue - this.appearance[3] << 48;
279279
}
280280
} else if (super.secondarySeqId >= 0) {
281281
primaryTransformId = SeqType.types[super.secondarySeqId].frames[super.secondarySeqFrame];
@@ -285,15 +285,15 @@ public final Model getAnimatedModel() {
285285
if (model == null) {
286286
boolean needsModel = false;
287287

288-
for (int part = 0; part < 12; part++) {
289-
int value = this.appearance[part];
288+
for (int slot = 0; slot < 12; slot++) {
289+
int value = this.appearance[slot];
290290

291-
if (leftHandValue >= 0 && part == 3) {
292-
value = leftHandValue;
291+
if (rightHandValue >= 0 && slot == 3) {
292+
value = rightHandValue;
293293
}
294294

295-
if (rightHandValue >= 0 && part == 5) {
296-
value = rightHandValue;
295+
if (leftHandValue >= 0 && slot == 5) {
296+
value = leftHandValue;
297297
}
298298

299299
if (value >= 0x100 && value < 0x200 && !IdkType.types[value - 0x100].modelIsReady()) {
@@ -322,12 +322,12 @@ public final Model getAnimatedModel() {
322322

323323
for (int i = 0; i < 12; i++) {
324324
int part = this.appearance[i];
325-
if (leftHandValue >= 0 && i == 3) {
326-
part = leftHandValue;
327-
}
328-
if (rightHandValue >= 0 && i == 5) {
325+
if (rightHandValue >= 0 && i == 3) {
329326
part = rightHandValue;
330327
}
328+
if (leftHandValue >= 0 && i == 5) {
329+
part = leftHandValue;
330+
}
331331

332332
if (part >= 0x100 && part < 0x200) {
333333
Model idkModel = IdkType.types[part - 0x100].getModel();

0 commit comments

Comments
 (0)