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

[svn] *** Source Mangos ***
*Load npc_options at server startup, use cached data at creature gossip menu init.
* Also new .reload table command added
*Implement npc_option localization support, also store in DB BoxText/BoxMoney/Coded?
* Use characters.guid instead low guid value from characters.data in charcter enum data prepering for client.
* Fixed crash at .pinfo command use from console.
* Fixed windows ad.exe build
*Creature related code and DB cleanups.
* Rename 2 creature_template fields to more clean names and related code update also.
* Use enum values instead raw values for type_flags, use halper functions instead code repeating.
* Move tamed pet creating code to new function.

** Small code changes to make things compliant with above changes.
** Another rev with big changes so test away.

Original author: KingPin?
Date: 2008-11-05 09:22:56-06:00

Files:
1 modified

Legend:

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

    r149 r168  
    13531353    // always send the flag if declined names aren't used 
    13541354    // to let the client select a default method of declining the name 
    1355     if(!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) || (result && result->Fetch()[12].GetCppString() != "")) 
     1355    if(!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) || (result && result->Fetch()[13].GetCppString() != "")) 
    13561356        char_flags |= CHARACTER_FLAG_DECLINED; 
    13571357 
     
    13711371            Field* fields = result->Fetch(); 
    13721372 
    1373             uint32 entry = fields[9].GetUInt32(); 
     1373            uint32 entry = fields[10].GetUInt32(); 
    13741374            CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry); 
    13751375            if(cInfo) 
    13761376            { 
    1377                 petDisplayId = fields[10].GetUInt32(); 
    1378                 petLevel     = fields[11].GetUInt32(); 
     1377                petDisplayId = fields[11].GetUInt32(); 
     1378                petLevel     = fields[12].GetUInt32(); 
    13791379                petFamily    = cInfo->family; 
    13801380            } 
     
    1349613496    if(!result) 
    1349713497    { 
    13498         //                                        0     1     2           3           4           5    6          7          8 
    13499         result = CharacterDatabase.PQuery("SELECT data, name, position_x, position_y, position_z, map, totaltime, leveltime, at_login FROM characters WHERE guid = '%u'",guid); 
     13498        //                                        0     1     2     3           4           5           6    7          8          9 
     13499        result = CharacterDatabase.PQuery("SELECT guid, data, name, position_x, position_y, position_z, map, totaltime, leveltime, at_login FROM characters WHERE guid = '%u'",guid); 
    1350013500        if(!result) return false; 
    1350113501    } 
     
    1350413504    Field *fields = result->Fetch(); 
    1350513505 
    13506     if(!LoadValues( fields[0].GetString())) 
     13506    if(!LoadValues( fields[1].GetString())) 
    1350713507    { 
    1350813508        sLog.outError("ERROR: Player #%d have broken data in `data` field. Can't be loaded.",GUID_LOPART(guid)); 
     
    1351413514    SetUInt64Value(OBJECT_FIELD_GUID, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); 
    1351513515 
    13516     m_name = fields[1].GetCppString(); 
    13517  
    13518     Relocate(fields[2].GetFloat(),fields[3].GetFloat(),fields[4].GetFloat()); 
    13519     SetMapId(fields[5].GetUInt32()); 
     13516    m_name = fields[2].GetCppString(); 
     13517 
     13518    Relocate(fields[3].GetFloat(),fields[4].GetFloat(),fields[5].GetFloat()); 
     13519    SetMapId(fields[6].GetUInt32()); 
    1352013520    // the instance id is not needed at character enum 
    1352113521 
    13522     m_Played_time[0] = fields[6].GetUInt32(); 
    13523     m_Played_time[1] = fields[7].GetUInt32(); 
    13524  
    13525     m_atLoginFlags = fields[8].GetUInt32(); 
     13522    m_Played_time[0] = fields[7].GetUInt32(); 
     13523    m_Played_time[1] = fields[8].GetUInt32(); 
     13524 
     13525    m_atLoginFlags = fields[9].GetUInt32(); 
    1352613526 
    1352713527    // I don't see these used anywhere ..