Skip to content

Commit

Permalink
item actors in heaps fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhael-Danilov committed Jan 8, 2025
1 parent c2898c2 commit 4633b1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.watabou.pixeldungeon.Badges;
import com.watabou.pixeldungeon.Dungeon;
import com.watabou.pixeldungeon.Statistics;
import com.watabou.pixeldungeon.actors.Actor;
import com.watabou.pixeldungeon.actors.Char;
import com.watabou.pixeldungeon.actors.buffs.Buff;
import com.watabou.pixeldungeon.actors.buffs.Burning;
Expand Down Expand Up @@ -60,6 +61,12 @@ public String name() {
return getEntityKind();
}

public void addActors() {
for (Item item : items) {
Actor.add(item);
}
}

public enum Type {
HEAP,
CHEST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ public void createGameScene(@NotNull Level level, @NotNull Hero hero) {

for (Heap heap : level.allHeaps()) { //so carcases cloud ne loaded
addHeapSprite(heap);
heap.addActors();
}

add(mobs);
Expand Down Expand Up @@ -689,12 +690,12 @@ private void addHeapSprite(@NotNull Heap heap) {
}

private void addDiscardedSprite(@NotNull Heap heap) {
heap.sprite = (DiscardedItemSprite) heaps.recycle(DiscardedItemSprite.class);
heap.sprite.setIsometricShift(true);
heap.sprite.revive();
heap.sprite.link(heap);
heap.sprite.setIsometricShift(true);
heaps.add(heap.sprite);
ItemSprite sprite = heap.sprite = (DiscardedItemSprite) heaps.recycle(DiscardedItemSprite.class);
sprite.setIsometricShift(true);
sprite.revive();
sprite.link(heap);
sprite.setIsometricShift(true);
heaps.add(sprite);
}

private static void addBlobSprite(final Blob gas) {
Expand Down

0 comments on commit 4633b1f

Please sign in to comment.