mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-01 02:14:32 +07:00
Added support for dropping cursor item to ground
This commit is contained in:
parent
d910a6026a
commit
6280e89d8b
@ -102,7 +102,7 @@ public class CursorMovementSystem extends BaseSystem {
|
||||
Vector2 position = mPosition.get(src).position;
|
||||
iso.toTile(tmpVec2.set(position));
|
||||
|
||||
Riiablo.cursor.setItem(null);
|
||||
Riiablo.charData.dropCursor();
|
||||
if (socket == null) {
|
||||
factory.createItem(cursor, tmpVec2);
|
||||
} else {
|
||||
|
@ -380,6 +380,10 @@ public class CharData implements ItemData.UpdateListener, Pool.Poolable {
|
||||
return itemData;
|
||||
}
|
||||
|
||||
public void dropCursor() {
|
||||
itemData.drop();
|
||||
}
|
||||
|
||||
public void itemToCursor(int i) {
|
||||
itemData.pickup(i);
|
||||
}
|
||||
|
@ -212,6 +212,14 @@ public class ItemData {
|
||||
setLocation(item, Location.CURSOR);
|
||||
}
|
||||
|
||||
// TODO: should item location change if the item is dropped? is this what UNK3 and UNK5 represent?
|
||||
void drop() {
|
||||
assert cursor != INVALID_ITEM;
|
||||
Item item = itemData.get(cursor);
|
||||
cursor = INVALID_ITEM;
|
||||
setLocation(item, null);
|
||||
}
|
||||
|
||||
void storeCursor(StoreLoc storeLoc, int x, int y) {
|
||||
assert cursor != INVALID_ITEM;
|
||||
store(storeLoc, cursor, x, y);
|
||||
|
Loading…
Reference in New Issue
Block a user