aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-11 16:17:37 -0600
committermegamage <none@none>2009-03-11 16:17:37 -0600
commit6e29ab4fbbb6b0fb0270d73120871ff5336d784f (patch)
tree7a3620ea5f9986f2cd3e0a262e7c7c808119cbf3 /src/game/GameObject.cpp
parent5286f2351f20b449921140d088b6eae6ef62a242 (diff)
[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
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index f967bb50dfc..d0c27cdde34 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -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)