mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
add safety measures to add function of GridLogic
This commit is contained in:
@@ -44,6 +44,8 @@ class GridLogic {
|
||||
return freeSlots;
|
||||
}
|
||||
add(item, prefer) {
|
||||
if (!item.frame)
|
||||
item.frame = this.getItemFrame(item);
|
||||
let occupiers = this.getItemsInFrame(item.frame);
|
||||
if (!occupiers.length) {
|
||||
item.frame.forEach(f => this.grid[f] = item.index);
|
||||
|
||||
Reference in New Issue
Block a user