mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user