Refactor + BugFix

1. Fix a bug in Admin Panel that you can edit by yourself your rank, now you cannot edit your rank anymore.

2. Now Alliance Leader can edit his own Position

3. Fix negative value on Demolition Building, now in database at lvl is appear new level not -1

4. Refactor Ajax map, now all is alligned (Ajax folder and Map folder)

5. Fix bug from Palace (when change capital now Automation recount population automaticaly on old capital and new capital)
This commit is contained in:
novgorodschi catalin
2026-05-18 09:18:35 +03:00
parent 2bce101a27
commit 55e6dd60b5
96 changed files with 6176 additions and 6763 deletions
+33 -33
View File
@@ -1,34 +1,34 @@
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($village->unitarray['hero'] != 0) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
?>
</tr><tr><th><?php echo TROOPS;?></th>
<?php
for($i=$start;$i<=$end;$i++) {
if($village->unitarray['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $village->unitarray['u'.$i]."</td>";
}
<?php
if($village->unitarray['hero'] != 0) {
echo "<td>";
echo $village->unitarray['hero']."</td>";
}
?>
</tr></tbody>
<tbody class="infos"><tr><th><?php echo UPKEEP;?></th>
<td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>"><?php echo $technology->getUpkeep($village->unitarray,0); ?><img class="r4" src="img/x.gif" title="Crop" alt="Crop" /><?php echo PER_HR;?></td></tr>
// RALLY POINT TROOPS
$tribe = $session->tribe;
$start = ($tribe - 1) * 10 + 1;
$end = $tribe * 10;
$hasHero = $village->unitarray['hero'] != 0;
$colspan = $hasHero ? 11 : 10;
?>
<tr><th>&nbsp;</th>
<?php for ($i = $start; $i <= $end; $i++): ?>
<td><img src="img/x.gif" class="unit u<?= $i ?>" title="<?= $technology->getUnitName($i) ?>" alt="<?= $technology->getUnitName($i) ?>"></td>
<?php endfor; ?>
<?php if ($hasHero): ?>
<td><img src="img/x.gif" class="unit uhero" title="Hero" alt="Hero"></td>
<?php endif; ?>
</tr>
<tr><th><?= TROOPS ?></th>
<?php for ($i = $start; $i <= $end; $i++):
$cnt = $village->unitarray['u'.$i] ?? 0;
?>
<td class="<?= $cnt == 0 ? 'none' : '' ?>"><?= $cnt ?></td>
<?php endfor; ?>
<?php if ($hasHero): ?>
<td><?= $village->unitarray['hero'] ?></td>
<?php endif; ?>
</tr>
</tbody>
<tbody class="infos">
<tr>
<th><?= UPKEEP ?></th>
<td colspan="<?= $colspan ?>"><?= $technology->getUpkeep($village->unitarray, 0) ?><img class="r4" src="img/x.gif" title="Crop" alt="Crop"><?= PER_HR ?></td>
</tr>