Fixed getHostile.
This commit is contained in:
parent
f64a54c61b
commit
3af090fb0b
@ -45,7 +45,6 @@ class GameDataManager {
|
|||||||
if (!key) return "";
|
if (!key) return "";
|
||||||
const langData = this.translations[this.currentLang];
|
const langData = this.translations[this.currentLang];
|
||||||
if (!langData) return key;
|
if (!langData) return key;
|
||||||
|
|
||||||
if (langData[key]) return langData[key];
|
if (langData[key]) return langData[key];
|
||||||
|
|
||||||
if (key.includes(".")) {
|
if (key.includes(".")) {
|
||||||
@ -106,13 +105,12 @@ class GameDataManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getHostile(id) {
|
getHostile(id) {
|
||||||
const cleanId = this._cleanId(id);
|
const hostile = this.hostiles.get(id);
|
||||||
const hostile = this.hostiles.get(cleanId);
|
|
||||||
|
|
||||||
if (!hostile) {
|
if (!hostile) {
|
||||||
return {
|
return {
|
||||||
id: cleanId,
|
id: id,
|
||||||
displayName: `Unknown Entity (${cleanId})`,
|
displayName: `Unknown Entity (${id})`,
|
||||||
level: 1,
|
level: 1,
|
||||||
stats: { hp: 100 },
|
stats: { hp: 100 },
|
||||||
};
|
};
|
||||||
@ -136,7 +134,6 @@ class GameDataManager {
|
|||||||
meta: { rarity: "common" },
|
meta: { rarity: "common" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
displayName: this.t(item.displayName),
|
displayName: this.t(item.displayName),
|
||||||
|
|||||||
Reference in New Issue
Block a user