Show
Ignore:
Timestamp:
11/22/08 00:35:41 (17 years ago)
Author:
yumileroy
Message:

Delete possessed AI only on creature delete.

Original author: gvcoman
Date: 2008-11-16 14:38:02-05:00

Files:
1 modified

Legend:

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

    r260 r272  
    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 
     
    314314            if (il) 
    315315            { 
    316                 if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) 
     316                if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty()) 
    317317                    Name = il->Name[loc_idx]; 
    318                 if (il->Description.size() > size_t(loc_idx) && !il->Description[loc_idx].empty()) 
     318                if (il->Description.size() > loc_idx && !il->Description[loc_idx].empty()) 
    319319                    Description = il->Description[loc_idx]; 
    320320            } 
     
    361361            data << pProto->Damage[i].DamageType; 
    362362        } 
    363  
    364         // resistances (7) 
    365363        data << pProto->Armor; 
    366364        data << pProto->HolyRes; 
     
    370368        data << pProto->ShadowRes; 
    371369        data << pProto->ArcaneRes; 
    372  
    373370        data << pProto->Delay; 
    374371        data << pProto->Ammo_type; 
    375         data << pProto->RangedModRange; 
    376  
     372 
     373        data << (float)pProto->RangedModRange; 
    377374        for(int s = 0; s < 5; s++) 
    378375        { 
     
    980977            if (il) 
    981978            { 
    982                 if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) 
     979                if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty()) 
    983980                    Name = il->Name[loc_idx]; 
    984981            } 
     
    10311028    } 
    10321029 
    1033     if(item==gift)                                          // not possable with pacjket from real client 
     1030    if(item==gift)                                          // not possible with pacjket from real client 
    10341031    { 
    10351032        _player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL ); 
     
    10761073    CharacterDatabase.BeginTransaction(); 
    10771074    CharacterDatabase.PExecute("INSERT INTO character_gifts VALUES ('%u', '%u', '%u', '%u')", GUID_LOPART(item->GetOwnerGUID()), item->GetGUIDLow(), item->GetEntry(), item->GetUInt32Value(ITEM_FIELD_FLAGS)); 
    1078     item->SetEntry(gift->GetEntry()); 
     1075    item->SetUInt32Value(OBJECT_FIELD_ENTRY, gift->GetUInt32Value(OBJECT_FIELD_ENTRY)); 
    10791076 
    10801077    switch (item->GetEntry()) 
    10811078    { 
    1082         case 5042:  item->SetEntry( 5043); break; 
    1083         case 5048:  item->SetEntry( 5044); break; 
    1084         case 17303: item->SetEntry(17302); break; 
    1085         case 17304: item->SetEntry(17305); break; 
    1086         case 17307: item->SetEntry(17308); break; 
    1087         case 21830: item->SetEntry(21831); break; 
     1079        case 5042:  item->SetUInt32Value(OBJECT_FIELD_ENTRY, 5043); break; 
     1080        case 5048:  item->SetUInt32Value(OBJECT_FIELD_ENTRY, 5044); break; 
     1081        case 17303: item->SetUInt32Value(OBJECT_FIELD_ENTRY, 17302); break; 
     1082        case 17304: item->SetUInt32Value(OBJECT_FIELD_ENTRY, 17305); break; 
     1083        case 17307: item->SetUInt32Value(OBJECT_FIELD_ENTRY, 17308); break; 
     1084        case 21830: item->SetUInt32Value(OBJECT_FIELD_ENTRY, 21831); break; 
    10881085    } 
    10891086    item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, _player->GetGUID());