fix 2
This commit is contained in:
@@ -286,7 +286,18 @@ window.openUnitModal = function() {
|
||||
let costStr = '';
|
||||
let clickable = false;
|
||||
|
||||
if (data) {
|
||||
const requiredGod = window.UNIT_GODS ? window.UNIT_GODS[key] : null;
|
||||
const isWrongGod = requiredGod && town.god !== requiredGod;
|
||||
const isNoGod = key === 'godsent' && !town.god;
|
||||
|
||||
if (isWrongGod) {
|
||||
statusClass = 'locked'; statusLabel = '🔒 Άλλος Θεός'; cardClass = 'bld-locked';
|
||||
const greekGods = { zeus: 'Δία', poseidon: 'Ποσειδώνα', hera: 'Ήρα', athena: 'Αθηνά', hades: 'Άδη', artemis: 'Άρτεμις', aphrodite: 'Αφροδίτη', ares: 'Άρη' };
|
||||
costStr = `Απαιτεί: ${greekGods[requiredGod] || requiredGod}`;
|
||||
} else if (isNoGod) {
|
||||
statusClass = 'locked'; statusLabel = '🔒 Χωρίς Θεό'; cardClass = 'bld-locked';
|
||||
costStr = `Απαιτείται Ναός`;
|
||||
} else if (data) {
|
||||
const missingKeys = data.missing_dependencies ? Object.keys(data.missing_dependencies) : [];
|
||||
const isLocked = missingKeys.length > 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user