mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7440] Use server-side only zone info. Optimize related calles in case zone and subzone use.
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.
This commit is contained in:
parent
071a0317f0
commit
329fb3f9d1
15 changed files with 103 additions and 56 deletions
|
|
@ -491,14 +491,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()
|
||||
|
|
@ -1019,11 +1020,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue