My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 20: Combats.php broken with raid logs
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  uncledan74
Closed:  Mar 2012


 
Reported by spoilerh...@gmail.com, Mar 5, 2012
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
#1 spoilerh...@gmail.com
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])?>
                }
        });

Mar 11, 2012
Project Member #3 uncledan74
Fixed in release 1.6.9. Thanks.
Status: Fixed

Powered by Google Project Hosting