[7440] Use server-side only zone info. Optimize related calles in case zone and subzone use. Author: VladimirMangos

This in some cases make some zones not explorable if it not have server side data in current maps
    but not allow cheating with zone set from client.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-11 16:17:37 -06:00
parent 5286f2351f
commit 6e29ab4fbb
15 changed files with 107 additions and 67 deletions

View File

@@ -498,14 +498,15 @@ void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner)
{
fishloot->clear();
uint32 subzone = GetAreaId();
uint32 zone, subzone;
GetZoneAndAreaId(zone,subzone);
// if subzone loot exist use it
if(LootTemplates_Fishing.HaveLootFor(subzone))
fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner,true);
// else use zone loot
else
fishloot->FillLoot(GetZoneId(), LootTemplates_Fishing, loot_owner,true);
fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true);
}
void GameObject::SaveToDB()
@@ -1078,11 +1079,12 @@ void GameObject::Use(Unit* user)
// 2) if skill == base_zone_skill => 5% chance
// 3) chance is linear dependence from (base_zone_skill-skill)
uint32 subzone = GetAreaId();
uint32 zone, subzone;
GetZoneAndAreaId(zone,subzone);
int32 zone_skill = objmgr.GetFishingBaseSkillLevel( subzone );
if(!zone_skill)
zone_skill = objmgr.GetFishingBaseSkillLevel( GetZoneId() );
zone_skill = objmgr.GetFishingBaseSkillLevel( zone );
//provide error, no fishable zone or area should be 0
if(!zone_skill)