Skip to content

Commit d578e8d

Browse files
committed
Add interaction mask decoding for GameObject definitions
1 parent f899469 commit d578e8d

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

cache/src/main/java/org/apollo/cache/decoder/ObjectDefinitionDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private ObjectDefinition decode(int id, ByteBuffer data) {
119119
} else if (opcode == 60 || opcode >= 65 && opcode <= 68) {
120120
data.getShort();
121121
} else if (opcode == 69) {
122-
data.get();
122+
definition.setInteractionMask(data.get());
123123
} else if (opcode >= 70 && opcode <= 72) {
124124
data.getShort();
125125
} else if (opcode == 73) {

cache/src/main/java/org/apollo/cache/def/ObjectDefinition.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public static ObjectDefinition lookup(int id) {
7575
*/
7676
private boolean impenetrable = true;
7777

78+
/**
79+
* A mask containing the set of directions from which this object can be interacted with.
80+
*/
81+
private int interactionMask;
82+
7883
/**
7984
* Denotes whether this object has actions associated with it or not.
8085
*/
@@ -137,6 +142,15 @@ public int getId() {
137142
return id;
138143
}
139144

145+
/**
146+
* Gets the interaction mask for this object.
147+
*
148+
* @return The interaction mask.
149+
*/
150+
public int getInteractionMask() {
151+
return interactionMask;
152+
}
153+
140154
/**
141155
* Gets the length of this object.
142156
*
@@ -236,6 +250,15 @@ public void setInteractive(boolean interactive) {
236250
this.interactive = interactive;
237251
}
238252

253+
/**
254+
* Sets the interaction mask for this object.
255+
*
256+
* @param interactionMask The interaction mask.
257+
*/
258+
public void setInteractionMask(int interactionMask) {
259+
this.interactionMask = interactionMask;
260+
}
261+
239262
/**
240263
* Sets the length of this object.
241264
*

0 commit comments

Comments
 (0)