| Issue 20: | Combats.php broken with raid logs |
‹ Prev
6 of 6
|
| 1 person starred this issue and may be notified of changes. | Back to list |
money raid log and probably others break combat.php
fix:
replace the appropriate lines in combat.php with
foreach ($combats as $cmbt):
if ($cmbt->getType() == "Ship vs NPC" || $cmbt->getType() == "Ship vs Ship"):
$cr = split(";", $cmbt->getData());
$len = count($cr);
$stats = $len-9;
for($i=1;$i<16;$i++){
if($cr[$len-$i] =="E") $stats=$len-$i;
}
?>
combats.push({
attacker: {
name: <?php printf("\"%s\"", $cmbt->getAttacker())?>,
image: <?php printf("\"%s\"", $cr[1])?>,
isNPC: <?php echo((int) (stripos($npcImages, $cr[1]) !== false))?>,
hullA: <?php echo($cr[2])?>,
armourA: <?php echo($cr[3])?>,
shieldA: <?php echo($cr[4])?>,
hullB: <?php echo($cr[$stats + 1])?>,
armourB: <?php echo($cr[$stats + 2])?>,
shieldB: <?php echo($cr[$stats + 3])?>
},
defender: {
name: <?php printf("\"%s\"", $cmbt->getDefender())?>,
image: <?php printf("\"%s\"", $cr[6])?>,
isNPC: <?php echo((int) (stripos($npcImages, $cr[6]) !== false))?>,
hullA: <?php echo($cr[7])?>,
armourA: <?php echo($cr[8])?>,
shieldA: <?php echo($cr[9])?>,
hullB: <?php echo($cr[$stats + 5])?>,
armourB: <?php echo($cr[$stats + 6])?>,
shieldB: <?php echo($cr[$stats + 7])?>
}
Mar 11, 2012
Fixed in release 1.6.9. Thanks.
Status:
Fixed
|
actually a much better fix: (this one works with multiple raided stuff as well foreach ($combats as $cmbt): if ($cmbt->getType() == "Ship vs NPC" || $cmbt->getType() == "Ship vs Ship"): $cr = split(";", $cmbt->getData()); $len = count($cr); $stats = $len-9; for($i=1;$i<=$len;$i++){ if($cr[$len-$i] =="E") $stats=$len-$i; } ?> combats.push({ attacker: { name: <?php printf("\"%s\"", $cmbt->getAttacker())?>, image: <?php printf("\"%s\"", $cr[1])?>, isNPC: <?php echo((int) (stripos($npcImages, $cr[1]) !== false))?>, hullA: <?php echo($cr[2])?>, armourA: <?php echo($cr[3])?>, shieldA: <?php echo($cr[4])?>, hullB: <?php echo($cr[$stats + 1])?>, armourB: <?php echo($cr[$stats + 2])?>, shieldB: <?php echo($cr[$stats + 3])?> }, defender: { name: <?php printf("\"%s\"", $cmbt->getDefender())?>, image: <?php printf("\"%s\"", $cr[6])?>, isNPC: <?php echo((int) (stripos($npcImages, $cr[6]) !== false))?>, hullA: <?php echo($cr[7])?>, armourA: <?php echo($cr[8])?>, shieldA: <?php echo($cr[9])?>, hullB: <?php echo($cr[$stats + 5])?>, armourB: <?php echo($cr[$stats + 6])?>, shieldB: <?php echo($cr[$stats + 7])?> } });