Skip to content

Commit

Permalink
ItemMover::FindDestination update
Browse files Browse the repository at this point in the history
try to keep items inside columns of a width of 2 when moving items around
  • Loading branch information
planqi committed May 4, 2019
1 parent 5005b19 commit 3ec8fbe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
22 changes: 20 additions & 2 deletions BH/Modules/ItemMover/ItemMover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ bool ItemMover::FindDestination(int xpac, int destination, unsigned int itemId,
bool found = false;
int destX = 0, destY = 0;
if (width) {
bool first_y = true;
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
bool abort = false;
Expand All @@ -255,11 +256,28 @@ bool ItemMover::FindDestination(int xpac, int destination, unsigned int itemId,
destY = y;
break;
}
}
if (xSize == 1) {
if (first_y) {
if (x + 1 < width) {
x++;
y--;
first_y = false;
}
} else {
first_y = true;
x--;
}
}
} // end y loop
if (found) {
break;
}
}
if (xSize == 2 && x % 2 == 0 && x + 2 >= width) {
x = 0;
} else {
x++;
}
} // end x loop
} else {
found = true;
}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ Mustache[stash]: {{#this}}* {{>item}}\n\n{{/this}}
```

# Release Notes for 1.9.3 (WIP)
* Add class item specific keywords
* Try to keep items inside columns of a width of two when moving items around
* Add class item specific keywords
* `BAR` `DRU` `DIN` `NEC` `SIN` `SOR` `ZON`
* They have the same functionality as `CL1` style selectors
* Add item type specific keywords
Expand Down

0 comments on commit 3ec8fbe

Please sign in to comment.