Removed some unnecessary database queries.

Removed unnecessary database queries in some command handlers.
Replaced them with access to cached data or queries for only the needed data.
Move database access in gossip select code to less often called place.
This commit is contained in:
hunuza 2008-11-02 15:58:24 +01:00
parent 8563b88859
commit f2852a95b7
3 changed files with 73 additions and 51 deletions

View file

@ -818,18 +818,20 @@ void Creature::OnGossipSelect(Player* player, uint32 option)
return;
}
uint32 textid=GetGossipTextId( action, zoneid);
if(textid==0)
textid=GetNpcTextId();
switch (gossip->Action)
{
case GOSSIP_OPTION_GOSSIP:
{
uint32 textid = GetGossipTextId(action, zoneid);
if (textid == 0)
textid=GetNpcTextId();
player->PlayerTalkClass->CloseGossip();
player->PlayerTalkClass->SendTalking( textid );
player->PlayerTalkClass->SendTalking(textid);
break;
}
case GOSSIP_OPTION_SPIRITHEALER:
if( player->isDead() )
if (player->isDead())
CastSpell(this,17251,true,NULL,NULL,player->GetGUID());
break;
case GOSSIP_OPTION_QUESTGIVER: