HikeGame / 2moons-2.0

Version 2.0 of 2moons compatible PHP 7.2
MIT License
49 stars 39 forks source link

MissionCaseAttack, MissionCaseDestruction Debris update increase #12

Closed byazrail closed 5 years ago

byazrail commented 5 years ago

Hi, Reference bug on forum; https://2moons.de/index.php?thread/750-debris-bug/

byazrail commented 5 years ago

MissionCaseAttack. moon attack type debris field not possible merge type. https://github.com/HikeGame/2moons-2.0/blob/master/includes/classes/missions/MissionCaseAttack.class.php#L330 330 lines. if($this->_fleet['fleet_end_type'] == 3) { // Use planet debris, if attack on moons $sql= "SELECT der_metal, der_crystal FROM %%PLANETS%% WHERE id_luna = :moonId;"; $targetDebris= $db->selectSingle($sql, array( ':moonId' => $this->_fleet['fleet_end_id'] )); $targetPlanet['der_metal']= $targetDebris['der_metal']; $targetPlanet['der_crystal'] = $targetDebris['der_crystal']; }

HikeGame commented 5 years ago

The code via the issue is not correct because it will multiply the debris

byazrail commented 5 years ago

MissionCaseDestruction https://github.com/HikeGame/2moons-2.0/blob/master/includes/classes/missions/MissionCaseDestruction.class.php#L322 332 lines. if($this->_fleet['fleet_end_type'] == 3) { // Use planet debris, if attack on moons $sql= "SELECT der_metal, der_crystal FROM %%PLANETS%% WHERE id_luna = :moonId;"; $targetDebris= $db->selectSingle($sql, array( ':moonId' => $this->_fleet['fleet_end_id'] )); $targetPlanet['der_metal']= $targetDebris['der_metal']; $targetPlanet['der_crystal'] = $targetDebris['der_crystal']; }

byazrail commented 5 years ago

Not multiply removed first comment.

HikeGame commented 5 years ago

commit ok https://github.com/HikeGame/2moons-2.0/commit/5d15d3f28309b130891a92f3a8c5f6a7e1f8c713