mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 00:31:54 +00:00
This update resolves dginovker/2006rebotted#166
Added proper object size calculations. Removed old objectDistance code. Added current task support, allows easy creation of player tasks that cannot duplicate.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package redone.game.objects;
|
||||
|
||||
import redone.world.clip.ObjectDef;
|
||||
|
||||
public class Objects {
|
||||
|
||||
public long delay, oDelay;
|
||||
@@ -36,6 +38,33 @@ public class Objects {
|
||||
objectTicks = ticks;
|
||||
}
|
||||
|
||||
public int[] getObjectSize() {
|
||||
ObjectDef def = ObjectDef.getObjectDef(objectId);
|
||||
if (def == null)
|
||||
return new int[] {1, 1};
|
||||
int xLength;
|
||||
int yLength;
|
||||
if (objectFace != 1 && objectFace != 3) {
|
||||
xLength = def.xLength();
|
||||
yLength = def.yLength();
|
||||
} else {
|
||||
xLength = def.yLength();
|
||||
yLength = def.xLength();
|
||||
}
|
||||
|
||||
return new int[] {xLength, yLength};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Objects{" +
|
||||
"objectId=" + objectId +
|
||||
", objectX=" + objectX +
|
||||
", objectY=" + objectY +
|
||||
", objectHeight=" + objectHeight +
|
||||
'}';
|
||||
}
|
||||
|
||||
public int getObjectHeight() {
|
||||
return objectHeight;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user