mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Fixed typo in log output and misc code cleanups.
This commit is contained in:
parent
014ab283dd
commit
ed14e59de4
3 changed files with 31 additions and 34 deletions
|
|
@ -1112,10 +1112,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||||
CHECK_PACKET_SIZE(recv_data,8*4);
|
CHECK_PACKET_SIZE(recv_data,8*4);
|
||||||
|
|
||||||
uint64 guids[4];
|
uint64 guids[4];
|
||||||
uint32 GemEnchants[3], OldEnchants[3];
|
|
||||||
Item *Gems[3];
|
|
||||||
bool SocketBonusActivated, SocketBonusToBeActivated;
|
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++)
|
for(int i = 0; i < 4; i++)
|
||||||
recv_data >> guids[i];
|
recv_data >> guids[i];
|
||||||
|
|
||||||
|
|
@ -1133,6 +1129,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||||
//this slot is excepted when applying / removing meta gem bonus
|
//this slot is excepted when applying / removing meta gem bonus
|
||||||
uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT;
|
uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT;
|
||||||
|
|
||||||
|
Item *Gems[3];
|
||||||
for(int i = 0; i < 3; i++)
|
for(int i = 0; i < 3; i++)
|
||||||
Gems[i] = guids[i + 1] ? _player->GetItemByGuid(guids[i + 1]) : NULL;
|
Gems[i] = guids[i + 1] ? _player->GetItemByGuid(guids[i + 1]) : NULL;
|
||||||
|
|
||||||
|
|
@ -1152,6 +1149,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 GemEnchants[3], OldEnchants[3];
|
||||||
for(int i = 0; i < 3; ++i) //get new and old enchantments
|
for(int i = 0; i < 3; ++i) //get new and old enchantments
|
||||||
{
|
{
|
||||||
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
|
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
|
||||||
|
|
@ -1200,7 +1198,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SocketBonusActivated = itemTarget->GemsFitSockets(); //save state of socketbonus
|
bool SocketBonusActivated = itemTarget->GemsFitSockets(); //save state of socketbonus
|
||||||
_player->ToggleMetaGemsActive(slot, false); //turn off all metagems (except for the target item)
|
_player->ToggleMetaGemsActive(slot, false); //turn off all metagems (except for the target item)
|
||||||
|
|
||||||
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
|
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
|
||||||
|
|
@ -1222,7 +1220,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
|
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
|
||||||
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true);
|
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true);
|
||||||
|
|
||||||
SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
|
bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
|
||||||
if(SocketBonusActivated ^ SocketBonusToBeActivated) //if there was a change...
|
if(SocketBonusActivated ^ SocketBonusToBeActivated) //if there was a change...
|
||||||
{
|
{
|
||||||
_player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT,false);
|
_player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT,false);
|
||||||
|
|
|
||||||
|
|
@ -1600,7 +1600,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||||
{
|
{
|
||||||
if(proto->Class != dbcitem->Class)
|
if(proto->Class != dbcitem->Class)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) not correct ñlass %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
|
sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
|
||||||
// It safe let use Class from DB
|
// It safe let use Class from DB
|
||||||
}
|
}
|
||||||
/* disabled: have some strange wrong cases for Subclass values.
|
/* disabled: have some strange wrong cases for Subclass values.
|
||||||
|
|
|
||||||
|
|
@ -3807,35 +3807,34 @@ void Spell::EffectEnchantItemPerm(uint32 i)
|
||||||
|
|
||||||
p_caster->UpdateCraftSkill(m_spellInfo->Id);
|
p_caster->UpdateCraftSkill(m_spellInfo->Id);
|
||||||
|
|
||||||
if (m_spellInfo->EffectMiscValue[i])
|
uint32 enchant_id = m_spellInfo->EffectMiscValue[i];
|
||||||
|
if (!enchant_id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||||
|
if(!pEnchant)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// item can be in trade slot and have owner diff. from caster
|
||||||
|
Player* item_owner = itemTarget->GetOwner();
|
||||||
|
if(!item_owner)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
|
||||||
{
|
{
|
||||||
uint32 enchant_id = m_spellInfo->EffectMiscValue[i];
|
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||||
|
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
||||||
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
|
||||||
if(!pEnchant)
|
item_owner->GetName(),item_owner->GetSession()->GetAccountId());
|
||||||
return;
|
|
||||||
|
|
||||||
// item can be in trade slot and have owner diff. from caster
|
|
||||||
Player* item_owner = itemTarget->GetOwner();
|
|
||||||
if(!item_owner)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
|
|
||||||
{
|
|
||||||
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
|
||||||
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
|
||||||
itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
|
|
||||||
item_owner->GetName(),item_owner->GetSession()->GetAccountId());
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove old enchanting before applying new if equipped
|
|
||||||
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false);
|
|
||||||
|
|
||||||
itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0);
|
|
||||||
|
|
||||||
// add new enchanting if equipped
|
|
||||||
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove old enchanting before applying new if equipped
|
||||||
|
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false);
|
||||||
|
|
||||||
|
itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0);
|
||||||
|
|
||||||
|
// add new enchanting if equipped
|
||||||
|
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectEnchantItemTmp(uint32 i)
|
void Spell::EffectEnchantItemTmp(uint32 i)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue