Changeset 28 for trunk/src/game/Player.cpp
- Timestamp:
- 11/19/08 13:24:39 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Player.cpp
r18 r28 266 266 SetAcceptTicket(true); 267 267 268 // players always a nd GM if set in config accept whispers by default269 if(GetSession()->GetSecurity() == SEC_PLAYER || sWorld.getConfig(CONFIG_GM_WISPERING_TO))268 // players always accept 269 if(GetSession()->GetSecurity() == SEC_PLAYER) 270 270 SetAcceptWhispers(true); 271 271 … … 1416 1416 // 0x2 - dnd 1417 1417 // 0x1 - afk 1418 if(isG ameMaster())1418 if(isGMChat()) 1419 1419 return 4; 1420 1420 else if(isDND()) … … 1556 1556 } 1557 1557 1558 SetSemaphoreTeleport(false);1559 1560 1558 if(!GetSession()->PlayerLogout()) 1559 { 1560 // don't reset teleport semaphore while logging out, otherwise m_teleport_dest won't be used in Player::SaveToDB 1561 SetSemaphoreTeleport(false); 1562 1561 1563 UpdateZone(GetZoneId()); 1564 } 1562 1565 1563 1566 // new zone … … 9323 9326 if( pProto ) 9324 9327 { 9328 // May be here should be more stronger checks; STUNNED checked 9329 // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. 9330 if (not_loading && hasUnitState(UNIT_STAT_STUNNED)) 9331 return EQUIP_ERR_YOU_ARE_STUNNED; 9332 9325 9333 if(pItem->IsBindedNotWith(GetGUID())) 9326 9334 return EQUIP_ERR_DONT_OWN_THAT_ITEM; … … 9346 9354 if(isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer != 0) 9347 9355 return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err 9356 9357 if(IsNonMeleeSpellCasted(false)) 9358 return EQUIP_ERR_CANT_DO_RIGHT_NOW; 9348 9359 9349 9360 uint8 eslot = FindEquipSlot( pProto, slot, swap ); … … 13799 13810 switch(sWorld.getConfig(CONFIG_GM_LOGIN_STATE)) 13800 13811 { 13801 case 0: // disable 13802 break; 13803 case 1: // enable 13804 SetGameMaster(true); 13805 break; 13812 default: 13813 case 0: break; // disable 13814 case 1: SetGameMaster(true); break; // enable 13806 13815 case 2: // save state 13807 if(gmstate )13816 if(gmstate & PLAYER_EXTRA_GM_ON) 13808 13817 SetGameMaster(true); 13809 13818 break; 13819 } 13820 13821 switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS)) 13822 { 13810 13823 default: 13824 case 0: break; // disable 13825 case 1: SetAcceptTicket(true); break; // enable 13826 case 2: // save state 13827 if(gmstate & PLAYER_EXTRA_GM_ACCEPT_TICKETS) 13828 SetAcceptTicket(true); 13829 break; 13830 } 13831 13832 switch(sWorld.getConfig(CONFIG_GM_CHAT)) 13833 { 13834 default: 13835 case 0: break; // disable 13836 case 1: SetGMChat(true); break; // enable 13837 case 2: // save state 13838 if(gmstate & PLAYER_EXTRA_GM_CHAT) 13839 SetGMChat(true); 13840 break; 13841 } 13842 13843 switch(sWorld.getConfig(CONFIG_GM_WISPERING_TO)) 13844 { 13845 default: 13846 case 0: break; // disable 13847 case 1: SetAcceptWhispers(true); break; // enable 13848 case 2: // save state 13849 if(gmstate & PLAYER_EXTRA_ACCEPT_WHISPERS) 13850 SetAcceptWhispers(true); 13811 13851 break; 13812 13852 } … … 14878 14918 14879 14919 ss << ", "; 14880 ss << (isGameMaster()? 1 : 0);14920 ss << m_ExtraFlags; 14881 14921 14882 14922 ss << ", "; … … 16388 16428 } 16389 16429 16390 VendorItem const* crItem = vItems->FindItem(item);16391 if( !crItem)16430 size_t vendor_slot = vItems->FindItemSlot(item); 16431 if(vendor_slot >= vItems->GetItemCount()) 16392 16432 { 16393 16433 SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0); 16394 16434 return false; 16395 16435 } 16436 16437 VendorItem const* crItem = vItems->m_items[vendor_slot]; 16396 16438 16397 16439 // check current item amount if it limited … … 16521 16563 WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); 16522 16564 data << pCreature->GetGUID(); 16523 data << (uint32) crItem->item;16565 data << (uint32)(vendor_slot+1); // numbered from 1 at client 16524 16566 data << (uint32)(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); 16525 16567 data << (uint32)count; … … 16560 16602 WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); 16561 16603 data << pCreature->GetGUID(); 16562 data << (uint32) crItem->item;16604 data << (uint32)(vendor_slot+1); // numbered from 1 at client 16563 16605 data << (uint32)(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); 16564 16606 data << (uint32)count;