Skip to content

Commit

Permalink
Fixing monster spawner check offset when looking for room to spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Interrupt committed Nov 20, 2018
1 parent 6e1dfb8 commit 6634b76
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Dungeoneer/assets/data/entities.dat
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@
},
"Achievement": { class: com.interrupt.dungeoneer.entities.triggers.TriggeredAchievement, floating: true }
},
"Spawners": {
"Item Spawner": {
class: com.interrupt.dungeoneer.entities.ItemSpawner
},
"Monster Spawner": {
class: com.interrupt.dungeoneer.entities.MonsterSpawner
},
"Entity Spawner": {
class: com.interrupt.dungeoneer.entities.EntitySpawner
}
},
"Movers": {
"Basic": { class: com.interrupt.dungeoneer.entities.Mover, isSolid: true, collision: {x: 0.5,y: 0.5,z: 0.1} },
"Trap": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public void placeMonster(Monster m, Level level) {
}
}

boolean levelFree = level.isFree(m.x - 0.5f, m.y - 0.5f, m.z, m.collision, m.stepHeight, m.floating, null);
boolean entityFree = level.checkEntityCollision(m.x - 0.5f, m.y - 0.5f, m.z, m.collision, m) == null;
boolean levelFree = level.isFree(m.x, m.y, m.z, m.collision, m.stepHeight, m.floating, null);
boolean entityFree = level.checkEntityCollision(m.x, m.y, m.z, m.collision, m) == null;
didPlace = levelFree && entityFree;
}

Expand Down

0 comments on commit 6634b76

Please sign in to comment.