Changeset 152 for trunk/src/game/Pet.cpp

Show
Ignore:
Timestamp:
11/19/08 13:41:09 (17 years ago)
Author:
yumileroy
Message:

[svn] Fix the compile error. Patch provided by Tidus.
Merge part of mangos svn rev 6748: Use SMSG_PET_NAME_INVALID opcode instead of db string. Source: Mangos.

Original author: megamage
Date: 2008-11-03 09:53:31-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Pet.cpp

    r149 r152  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    189189    if(!IsPositionValid()) 
    190190    { 
    191         sLog.outError("ERROR: Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %d Y: ^%d)", GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); 
     191        sLog.outError("ERROR: Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)", 
     192            GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); 
    192193        delete result; 
    193194        return false; 
     
    206207        return true; 
    207208    } 
    208     if(getPetType()==HUNTER_PET || getPetType()==SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK) 
     209    if(getPetType()==HUNTER_PET || (getPetType()==SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK)) 
    209210        m_charmInfo->SetPetNumber(pet_number, true); 
    210211    else 
     
    12191220        WorldPacket data(SMSG_SPELL_COOLDOWN, (8+1+result->GetRowCount()*8)); 
    12201221        data << GetGUID(); 
    1221         data << uint8(0x0); 
     1222        data << uint8(0x0);                                 // flags (0x1, 0x2) 
    12221223 
    12231224        do 
     
    13671368                remaincharges = -1; 
    13681369 
    1369                         /// do not load single target auras (unless they were cast by the player) 
    1370                         if (caster_guid != GetGUID() && IsSingleTargetSpell(spellproto)) 
    1371                                 continue; 
     1370            /// do not load single target auras (unless they were cast by the player) 
     1371            if (caster_guid != GetGUID() && IsSingleTargetSpell(spellproto)) 
     1372                continue; 
    13721373 
    13731374            Aura* aura = CreateAura(spellproto, effindex, NULL, this, NULL); 
     
    14011402 
    14021403        if (i != 3) 
    1403                         continue; 
    1404  
    1405                 if(itr->second->IsPassive()) 
    1406                         continue; 
    1407  
    1408                 /// do not save single target auras (unless they were cast by the player) 
    1409                 if (itr->second->GetCasterGUID() != GetGUID() && IsSingleTargetSpell(spellInfo)) 
    1410                         continue; 
    1411  
    1412                 CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,amount,maxduration,remaintime,remaincharges) " 
    1413                         "VALUES ('%u', '" I64FMTD "', '%u', '%u', '%d', '%d', '%d', '%d')", 
    1414                         m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(),(uint32)(*itr).second->GetId(), (uint32)(*itr).second->GetEffIndex(),(*itr).second->GetModifier()->m_amount,int((*itr).second->GetAuraMaxDuration()),int((*itr).second->GetAuraDuration()),int((*itr).second->m_procCharges)); 
     1404            continue; 
     1405         
     1406        if(itr->second->IsPassive()) 
     1407            continue; 
     1408 
     1409        /// do not save single target auras (unless they were cast by the player) 
     1410        if (itr->second->GetCasterGUID() != GetGUID() && IsSingleTargetSpell(spellInfo)) 
     1411            continue; 
     1412 
     1413        CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,amount,maxduration,remaintime,remaincharges) " 
     1414            "VALUES ('%u', '" I64FMTD "', '%u', '%u', '%d', '%d', '%d', '%d')", 
     1415            m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(),(uint32)(*itr).second->GetId(), (uint32)(*itr).second->GetEffIndex(),(*itr).second->GetModifier()->m_amount,int((*itr).second->GetAuraMaxDuration()),int((*itr).second->GetAuraDuration()),int((*itr).second->m_procCharges)); 
    14151416    } 
    14161417}