aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-16 14:32:47 -0600
committermegamage <none@none>2009-01-16 14:32:47 -0600
commit80263de422ad4e1cdb103eaec3a2acf74631f884 (patch)
treeb4da0d56676c397cd0ef5a83039e458f67ddd411 /src/game
parent40a1154c5befcfde3d584c71aa1d9a8b6cb1b638 (diff)
parenta8e7fb16493c05a25044c01c5b58ea08e485a97a (diff)
Update to Trinity 863.
--HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/BattleGroundAV.cpp2
-rw-r--r--src/game/CharacterHandler.cpp4
-rw-r--r--src/game/Chat.cpp1
-rw-r--r--src/game/Chat.h1
-rw-r--r--src/game/GameEvent.cpp2
-rw-r--r--src/game/Group.cpp21
-rw-r--r--src/game/Group.h3
-rw-r--r--src/game/GroupHandler.cpp12
-rw-r--r--src/game/Item.cpp8
-rw-r--r--src/game/Level2.cpp46
-rw-r--r--src/game/NPCHandler.cpp4
-rw-r--r--src/game/Object.cpp45
-rw-r--r--src/game/Object.h4
-rw-r--r--src/game/Pet.cpp4
-rw-r--r--src/game/SpellAuras.cpp2
-rw-r--r--src/game/TradeHandler.cpp2
-rw-r--r--src/game/Unit.cpp35
-rw-r--r--src/game/World.cpp7
-rw-r--r--src/game/World.h1
-rw-r--r--src/game/WorldSocket.cpp2
20 files changed, 168 insertions, 38 deletions
diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp
index 27cd169ffc3..6b892a0fa5d 100644
--- a/src/game/BattleGroundAV.cpp
+++ b/src/game/BattleGroundAV.cpp
@@ -125,7 +125,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
return;//maybe we should log this, cause this must be a cheater or a big bug
uint8 team = GetTeamIndexByTeamId(player->GetTeam());
//TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor
- sLog.outError("BG_AV Quest %i completed",questid);
+ sLog.outDebug("BG_AV Quest %i completed",questid);
switch(questid)
{
case AV_QUEST_A_SCRAPS1:
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index 7556e9e7c86..14c78201999 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -473,7 +473,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
SendPacket( &data );
std::string IP_str = GetRemoteAddress();
- sLog.outBasic("Account: %d (IP: %s) Create Character:[%s]",GetAccountId(),IP_str.c_str(),name.c_str());
+ sLog.outDetail("Account: %d (IP: %s) Create Character:[%s]",GetAccountId(),IP_str.c_str(),name.c_str());
sLog.outChar("Account: %d (IP: %s) Create Character:[%s]",GetAccountId(),IP_str.c_str(),name.c_str());
}
@@ -523,7 +523,7 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
return;
std::string IP_str = GetRemoteAddress();
- sLog.outBasic("Account: %d (IP: %s) Delete Character:[%s] (guid:%u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
+ sLog.outDetail("Account: %d (IP: %s) Delete Character:[%s] (guid:%u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
sLog.outChar("Account: %d (IP: %s) Delete Character:[%s] (guid: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
if(sLog.IsOutCharDump()) // optimize GetPlayerDump call
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 2b7b8fbbe41..300bb3cf3e8 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -443,6 +443,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL },
{ "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
{ "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL },
+ { "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL },
//{ TODO: fix or remove this commands
{ "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL },
diff --git a/src/game/Chat.h b/src/game/Chat.h
index 2626ebeb3ae..e83aef41c5b 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -205,6 +205,7 @@ class ChatHandler
bool HandleNpcUnFollowCommand(const char* args);
bool HandleNpcWhisperCommand(const char* args);
bool HandleNpcYellCommand(const char* args);
+ bool HandleNpcAddFormationCommand(const char* args);
bool HandleReloadAllCommand(const char* args);
bool HandleReloadAllAreaCommand(const char* args);
diff --git a/src/game/GameEvent.cpp b/src/game/GameEvent.cpp
index 17084dd3ebf..9ceed9024c4 100644
--- a/src/game/GameEvent.cpp
+++ b/src/game/GameEvent.cpp
@@ -1016,7 +1016,7 @@ uint32 GameEvent::Update() // return the next e
nextEventDelay = 0;
for(std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
StopEvent(*itr);
- sLog.outBasic("Next game event check in %u seconds.", nextEventDelay + 1);
+ sLog.outDetail("Next game event check in %u seconds.", nextEventDelay + 1);
return (nextEventDelay + 1) * 1000; // Add 1 second to be sure event has started/stopped at next call
}
diff --git a/src/game/Group.cpp b/src/game/Group.cpp
index 8afac50da13..8254bf88bb8 100644
--- a/src/game/Group.cpp
+++ b/src/game/Group.cpp
@@ -295,12 +295,14 @@ bool Group::AddMember(const uint64 &guid, const char* name)
uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
{
+ BroadcastGroupUpdate();
+
// remove member and change leader (if need) only if strong more 2 members _before_ member remove
if(GetMembersCount() > (isBGGroup() ? 1 : 2)) // in BG group case allow 1 members group
{
bool leaderChanged = _removeMember(guid);
- Player *player = objmgr.GetPlayer( guid );
+ Player *player = objmgr.GetPlayer( guid ); // FG: TODO: could be removed, its just here for consistency
if (player)
{
WorldPacket data;
@@ -1521,3 +1523,20 @@ void Group::_homebindIfInstance(Player *player)
player->m_InstanceValid = false;
}
}
+
+void Group::BroadcastGroupUpdate(void)
+{
+ // FG: HACK: force flags update on group leave - for values update hack
+ // -- not very efficient but safe
+ for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
+ {
+
+ Player *pp = objmgr.GetPlayer(citr->guid);
+ if(pp && pp->IsInWorld())
+ {
+ pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
+ pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);
+ DEBUG_LOG("-- Forced group value update for '%s'", pp->GetName());
+ }
+ }
+} \ No newline at end of file
diff --git a/src/game/Group.h b/src/game/Group.h
index 5edc99f8c0c..aef5a8619af 100644
--- a/src/game/Group.h
+++ b/src/game/Group.h
@@ -331,6 +331,9 @@ class TRINITY_DLL_SPEC Group
InstanceGroupBind* GetBoundInstance(uint32 mapid, uint8 difficulty);
BoundInstancesMap& GetBoundInstances(uint8 difficulty) { return m_boundInstances[difficulty]; }
+ // FG: evil hacks
+ void BroadcastGroupUpdate(void);
+
protected:
bool _addMember(const uint64 &guid, const char* name, bool isAssistant=false);
bool _addMember(const uint64 &guid, const char* name, bool isAssistant, uint8 group);
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
index ab6b8d4a939..5a74550c12a 100644
--- a/src/game/GroupHandler.cpp
+++ b/src/game/GroupHandler.cpp
@@ -216,6 +216,8 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
uint8 subgroup = group->GetMemberGroup(GetPlayer()->GetGUID());
GetPlayer()->SetGroup(group, subgroup);
+
+ group->BroadcastGroupUpdate();
}
void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
@@ -724,8 +726,9 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
uint32 updatedAura = player->GetVisibleAura(i);
*data << uint32(updatedAura);
*data << uint8(1);
- if(!updatedAura)
- player->UnsetAuraUpdateMask(i);
+ //TODO: find a safe place to do this cleanup
+ //if(!updatedAura)
+ //player->UnsetAuraUpdateMask(i);
}
}
}
@@ -808,8 +811,9 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
uint32 updatedAura = pet->GetVisibleAura(i);
*data << uint32(updatedAura);
*data << uint8(1);
- if(!updatedAura)
- pet->UnsetAuraUpdateMask(i);
+ //TODO: find a safe place to do this cleanup
+ //if(!updatedAura)
+ //pet->UnsetAuraUpdateMask(i);
}
}
}
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index ccd5a4d558c..c39b573e24a 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -645,14 +645,14 @@ void Item::AddToUpdateQueueOf(Player *player)
player = GetOwner();
if (!player)
{
- sLog.outError("Item::AddToUpdateQueueOf - GetPlayer didn't find a player matching owner's guid (%u)!", GUID_LOPART(GetOwnerGUID()));
+ sLog.outDebug("Item::AddToUpdateQueueOf - GetPlayer didn't find a player matching owner's guid (%u)!", GUID_LOPART(GetOwnerGUID()));
return;
}
}
if (player->GetGUID() != GetOwnerGUID())
{
- sLog.outError("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
+ sLog.outDebug("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
return;
}
@@ -671,14 +671,14 @@ void Item::RemoveFromUpdateQueueOf(Player *player)
player = GetOwner();
if (!player)
{
- sLog.outError("Item::RemoveFromUpdateQueueOf - GetPlayer didn't find a player matching owner's guid (%u)!", GUID_LOPART(GetOwnerGUID()));
+ sLog.outDebug("Item::RemoveFromUpdateQueueOf - GetPlayer didn't find a player matching owner's guid (%u)!", GUID_LOPART(GetOwnerGUID()));
return;
}
}
if (player->GetGUID() != GetOwnerGUID())
{
- sLog.outError("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
+ sLog.outDebug("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
return;
}
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index a54a66300be..ebf17571b35 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -4366,3 +4366,49 @@ bool ChatHandler::HandleTempGameObjectCommand(const char* args)
return true;
}
+
+bool ChatHandler::HandleNpcAddFormationCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint32 leaderGUID = (uint32) atoi((char*)args);
+ Creature *pCreature = getSelectedCreature();
+
+ if(!pCreature || !pCreature->GetDBTableGUIDLow())
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 lowguid = pCreature->GetDBTableGUIDLow();
+ if(pCreature->GetFormationID())
+ {
+ PSendSysMessage("Selected creature is already member of group %u", pCreature->GetFormationID());
+ return false;
+ }
+
+ if (!lowguid)
+ return false;
+
+ Player *chr = m_session->GetPlayer();
+ FormationMember *group_member;
+
+ group_member = new FormationMember;
+ group_member->follow_angle = pCreature->GetAngle(chr) - chr->GetOrientation();
+ group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(),int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(),int(2)));
+ group_member->memberGUID = lowguid;
+ group_member->leaderGUID = leaderGUID;
+ group_member->groupAI = 0;
+
+ CreatureGroupMap[lowguid] = group_member;
+ pCreature->SearchFormation();
+
+ WorldDatabase.PExecuteLog("INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`) VALUES ('%u','%u','%f', '%f', '%u')",
+ leaderGUID, lowguid, group_member->follow_dist, group_member->follow_angle, group_member->groupAI);
+
+ PSendSysMessage("Creature %u added to formation with leader %u", lowguid, leaderGUID);
+
+ return true;
+ }
diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp
index 19de60c6b53..a99208e63bd 100644
--- a/src/game/NPCHandler.cpp
+++ b/src/game/NPCHandler.cpp
@@ -328,9 +328,9 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
{
// recheck
CHECK_PACKET_SIZE(recv_data,8+4+1);
- sLog.outBasic("reading string");
+ sLog.outDebug("reading string");
recv_data >> code;
- sLog.outBasic("string read: %s", code.c_str());
+ sLog.outDebug("string read: %s", code.c_str());
}
Creature *unit = ObjectAccessor::GetNPCIfCanInteractWith(*_player, guid, UNIT_NPC_FLAG_NONE);
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 226129c392d..50ed59d2486 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -653,6 +653,38 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
else
*data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_OTHER_TAGGER);
}
+ // FG: pretend that OTHER players in own group are friendly ("blue")
+ else if(index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
+ {
+ bool ch = false;
+ if(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER && target != this)
+ {
+ if(target->IsInSameGroupWith((Player*)this) || target->IsInSameRaidWith((Player*)this))
+ {
+ if(index == UNIT_FIELD_BYTES_2)
+ {
+ DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
+ *data << ( m_uint32Values[ index ] & (UNIT_BYTE2_FLAG_SANCTUARY << 8) ); // this flag is at uint8 offset 1 !!
+ ch = true;
+ }
+ else if(index == UNIT_FIELD_FACTIONTEMPLATE)
+ {
+ FactionTemplateEntry const *ft1, *ft2;
+ ft1 = ((Player*)this)->getFactionTemplateEntry();
+ ft2 = ((Player*)target)->getFactionTemplateEntry();
+ if(ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
+ {
+ uint32 faction = ((Player*)target)->getFaction(); // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
+ DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (faction %u)", target->GetName(), ((Player*)this)->GetName(), faction);
+ *data << uint32(faction);
+ ch = true;
+ }
+ }
+ }
+ }
+ if(!ch)
+ *data << m_uint32Values[ index ];
+ }
else
{
// send in current format (float as float, uint32 as uint32)
@@ -1324,6 +1356,19 @@ void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf)
SendMessageToSet( &data, true ); // ToSelf ignored in this case
}
+void Object::ForceValuesUpdateAtIndex(uint32 i)
+{
+ m_uint32Values_mirror[i] = GetUInt32Value(i) + 1; // makes server think the field changed
+ if(m_inWorld)
+ {
+ if(!m_objectUpdated)
+ {
+ ObjectAccessor::Instance().AddUpdateObject(this);
+ m_objectUpdated = true;
+ }
+ }
+}
+
namespace Trinity
{
class MessageChatLocaleCacheDo
diff --git a/src/game/Object.h b/src/game/Object.h
index 815111eb91b..2e29b4daec1 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -302,6 +302,10 @@ class TRINITY_DLL_SPEC Object
virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
+
+ // FG: some hacky helpers
+ void ForceValuesUpdateAtIndex(uint32);
+
protected:
Object ( );
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 834362a0d5c..6c77138c38c 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -736,10 +736,10 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
}
uint32 guid=objmgr.GenerateLowGuid(HIGHGUID_PET);
- sLog.outBasic("SetInstanceID()");
+ sLog.outDebug("SetInstanceID()");
SetInstanceId(creature->GetInstanceId());
- sLog.outBasic("Create pet");
+ sLog.outDebug("Create pet");
uint32 pet_number = objmgr.GeneratePetNumber();
if(!Create(guid, creature->GetMap(), creature->GetEntry(), pet_number))
return false;
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 6ee750e6e83..182bacf8ee8 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3371,7 +3371,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
Unit::AuraList const& mDummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
{
- if ((*i)->GetSpellProto()->SpellIconID == 2114)
+ if ((*i)->GetSpellProto()->SpellIconID == 2114 && Real)
{
if (apply)
{
diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp
index 58a18896e9f..dc3bd020ccf 100644
--- a/src/game/TradeHandler.cpp
+++ b/src/game/TradeHandler.cpp
@@ -536,7 +536,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return;
}
- if(pOther->GetTeam() !=_player->GetTeam() )
+ if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam() )
{
SendTradeStatus(TRADE_STATUS_WRONG_FACTION);
return;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 54d0f54c88f..9b41f52e124 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -382,9 +382,9 @@ void Unit::GetRandomContactPoint( const Unit* obj, float &x, float &y, float &z,
float combat_reach = GetCombatReach();
if(combat_reach < 0.1) // sometimes bugged for players
{
- sLog.outError("Unit %u (Type: %u) has invalid combat_reach %f",GetGUIDLow(),GetTypeId(),combat_reach);
- if(GetTypeId() == TYPEID_UNIT)
- sLog.outError("Creature entry %u has invalid combat_reach", ((Creature*)this)->GetEntry());
+ //sLog.outError("Unit %u (Type: %u) has invalid combat_reach %f",GetGUIDLow(),GetTypeId(),combat_reach);
+ // if(GetTypeId() == TYPEID_UNIT)
+ // sLog.outError("Creature entry %u has invalid combat_reach", ((Creature*)this)->GetEntry());
combat_reach = DEFAULT_COMBAT_REACH;
}
uint32 attacker_number = getAttackers().size();
@@ -3927,6 +3927,11 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
Aura* Aur = i->second;
SpellEntry const* AurSpellInfo = Aur->GetSpellProto();
+ // some ShapeshiftBoosts at remove trigger removing other auras including parent Shapeshift aura
+ // remove aura from list before to prevent deleting it before
+ m_Auras.erase(i);
+ ++m_removedAuras; // internal count used by unit update
+
Unit* caster = NULL;
if (IsSingleTargetSpell(AurSpellInfo))
{
@@ -3946,22 +3951,20 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
// remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
if (Aur->GetModifier()->m_auraname < TOTAL_AURAS)
{
- m_modAuras[(*i).second->GetModifier()->m_auraname].remove((*i).second);
- if((*i).second->GetSpellProto()->AuraInterruptFlags)
+ m_modAuras[Aur->GetModifier()->m_auraname].remove(Aur);
+
+ if(Aur->GetSpellProto()->AuraInterruptFlags)
{
- m_interruptableAuras.remove((*i).second);
+ m_interruptableAuras.remove(Aur);
UpdateInterruptMask();
}
- if((*i).second->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE)
- m_ccAuras.remove((*i).second);
+
+ if(Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE)
+ m_ccAuras.remove(Aur);
}
// Set remove mode
Aur->SetRemoveMode(mode);
- // some ShapeshiftBoosts at remove trigger removing other auras including parent Shapeshift aura
- // remove aura from list before to prevent deleting it before
- m_Auras.erase(i);
- ++m_removedAuras; // internal count used by unit update
// Statue unsummoned at aura remove
Totem* statue = NULL;
@@ -3982,12 +3985,12 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)Aur->GetSpellProto()->Id))
{
- for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
+ for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
if(spell_triggered < 0)
- RemoveAurasDueToSpell(-(*i));
+ RemoveAurasDueToSpell(-(*itr));
else if(Unit* caster = Aur->GetCaster())
- CastSpell(this, *i, true, 0, 0, caster->GetGUID());
+ CastSpell(this, *itr, true, 0, 0, caster->GetGUID());
}
}
@@ -11251,6 +11254,8 @@ bool Unit::HandleMeandingAuraProc( Aura* triggeredByAura )
void Unit::RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo)
{
uint64 target_guid = GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT);
+ if(target_guid == GetGUID())
+ return;
if(!IS_UNIT_GUID(target_guid))
return;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 8861005e55c..82821f44544 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -612,6 +612,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Mail",false);
m_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig.GetBoolDefault("AllowTwoSide.WhoList", false);
m_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig.GetBoolDefault("AllowTwoSide.AddFriend", false);
+ m_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig.GetBoolDefault("AllowTwoSide.trade", false);
m_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfig.GetIntDefault("StrictPlayerNames", 0);
m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault("StrictCharterNames", 0);
m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault("StrictPetNames", 0);
@@ -736,7 +737,7 @@ void World::LoadConfigSettings(bool reload)
{
sLog.outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_configs[CONFIG_START_ARENA_POINTS],m_configs[CONFIG_MAX_ARENA_POINTS],0);
- m_configs[CONFIG_MAX_ARENA_POINTS] = 0;
+ m_configs[CONFIG_START_ARENA_POINTS] = 0;
}
else if(m_configs[CONFIG_START_ARENA_POINTS] > m_configs[CONFIG_MAX_ARENA_POINTS])
{
@@ -1360,7 +1361,7 @@ void World::SetInitialWorldSettings()
exit(1);
///- Initialize game time and timers
- sLog.outString( "DEBUG:: Initialize game time and timers" );
+ sLog.outDebug( "DEBUG:: Initialize game time and timers" );
m_gameTime = time(NULL);
m_startTime=m_gameTime;
@@ -1505,7 +1506,7 @@ void World::Update(time_t diff)
{
if(m_updateTimeSum > m_configs[CONFIG_INTERVAL_LOG_UPDATE])
{
- sLog.outString("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
+ sLog.outBasic("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
m_updateTimeSum = m_updateTime;
m_updateTimeCount = 1;
}
diff --git a/src/game/World.h b/src/game/World.h
index 76fd396d5b6..c684ac11e96 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -96,6 +96,7 @@ enum WorldConfigs
CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL,
CONFIG_ALLOW_TWO_SIDE_WHO_LIST,
CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND,
+ CONFIG_ALLOW_TWO_SIDE_TRADE,
CONFIG_STRICT_PLAYER_NAMES,
CONFIG_STRICT_CHARTER_NAMES,
CONFIG_STRICT_PET_NAMES,
diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
index 5dc8c4cddb3..a25d05567b3 100644
--- a/src/game/WorldSocket.cpp
+++ b/src/game/WorldSocket.cpp
@@ -939,7 +939,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
SendPacket (packet);
- sLog.outBasic ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
+ sLog.outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
return -1;
}