fix: 解决不拿怪物手册报错

This commit is contained in:
AncTe committed 2023-09-29 17:53:42 +08:00
1 parent 02e2934b9a
commit 17633b094d
4 files changed
+9 -9

No files matched your search

+3 -3
View File
@@ -6,7 +6,7 @@ control.prototype.checkBlock = function (forceMockery: boolean = false) {
const x = core.getHeroLoc('x'),
y = core.getHeroLoc('y'),
loc = x + ',' + y;
const info = core.status.thisMap.enemy?.mapDamage[loc];
const info = core.status.thisMap.enemy.mapDamage[loc];
const damage = info?.damage;
if (damage) {
if (!main.replayChecking) {
@@ -145,7 +145,7 @@ control.prototype.moveHero = function (direction: Dir, callback: () => void) {
const nx = core.nextX();
const ny = core.nextY();
if (core.status.thisMap.enemy?.mapDamage[`${nx},${ny}`]?.mockery) {
if (core.status.thisMap.enemy.mapDamage[`${nx},${ny}`]?.mockery) {
core.autosave();
}
@@ -155,7 +155,7 @@ control.prototype.moveHero = function (direction: Dir, callback: () => void) {
function checkMockery(loc: string, force: boolean = false) {
if (core.status.lockControl && !force) return;
const mockery = core.status.thisMap.enemy?.mapDamage[loc]?.mockery;
const mockery = core.status.thisMap.enemy.mapDamage[loc]?.mockery;
if (mockery) {
mockery.sort((a, b) => (a[0] === b[0] ? a[1] - b[1] : a[0] - b[0]));
const action = [];
+1 -1
View File
@@ -6,7 +6,7 @@ core.control.updateDamage = function (floorId = core.status.floorId, ctx) {
const floor = core.status.maps[floorId];
// 没有怪物手册
if (!core.hasItem('book')) return;
// if (!core.hasItem('book')) return;
core.status.damage.posX = core.bigmap.posX;
core.status.damage.posY = core.bigmap.posY;
if (!onMap) {