Changeset 272 for trunk/src/game/ItemHandler.cpp
- Timestamp:
- 11/22/08 00:35:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ItemHandler.cpp
r260 r272 11 11 * This program is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 … … 314 314 if (il) 315 315 { 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()) 317 317 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()) 319 319 Description = il->Description[loc_idx]; 320 320 } … … 361 361 data << pProto->Damage[i].DamageType; 362 362 } 363 364 // resistances (7)365 363 data << pProto->Armor; 366 364 data << pProto->HolyRes; … … 370 368 data << pProto->ShadowRes; 371 369 data << pProto->ArcaneRes; 372 373 370 data << pProto->Delay; 374 371 data << pProto->Ammo_type; 375 data << pProto->RangedModRange; 376 372 373 data << (float)pProto->RangedModRange; 377 374 for(int s = 0; s < 5; s++) 378 375 { … … 980 977 if (il) 981 978 { 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()) 983 980 Name = il->Name[loc_idx]; 984 981 } … … 1031 1028 } 1032 1029 1033 if(item==gift) // not poss able with pacjket from real client1030 if(item==gift) // not possible with pacjket from real client 1034 1031 { 1035 1032 _player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL ); … … 1076 1073 CharacterDatabase.BeginTransaction(); 1077 1074 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->Set Entry(gift->GetEntry());1075 item->SetUInt32Value(OBJECT_FIELD_ENTRY, gift->GetUInt32Value(OBJECT_FIELD_ENTRY)); 1079 1076 1080 1077 switch (item->GetEntry()) 1081 1078 { 1082 case 5042: item->Set Entry(5043); break;1083 case 5048: item->Set Entry(5044); break;1084 case 17303: item->Set Entry(17302); break;1085 case 17304: item->Set Entry(17305); break;1086 case 17307: item->Set Entry(17308); break;1087 case 21830: item->Set Entry(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; 1088 1085 } 1089 1086 item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, _player->GetGUID());