aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-10-06 21:01:20 +0200
committerMachiavelli <none@none>2009-10-06 21:01:20 +0200
commita3de0f7ba0dbe107fd5b66f3d3518764abb2c0f6 (patch)
treef24c2e6d8cfbd5b54ef1006c06d6066713fc7304 /src
parent43b3f834cfa7403bbfe1ff9a25169278ba4a7259 (diff)
* Fix bug that caused a 100% chance to increase fishing skill on fishing regardless of area.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GameObject.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 75b51f8bb41..d7315f9626b 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1119,25 +1119,28 @@ void GameObject::Use(Unit* user)
DEBUG_LOG("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll);
- player->UpdateFishingSkill();
- // 3.1 changes, you can now fish anywhere and get fishing skillups
- // but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
- if(skill >= zone_skill && chance >= roll)
+ if(chance >= roll)
{
- // prevent removing GO at spell cancel
- player->RemoveGameObject(this,false);
- SetOwnerGUID(player->GetGUID());
-
- //TODO: find reasonable value for fishing hole search
- GameObject* ok = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE);
- if (ok)
+ player->UpdateFishingSkill();
+ // 3.1 changes, you can now fish anywhere and get fishing skillups
+ // but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
+ if(skill >= zone_skill)
{
- player->SendLoot(ok->GetGUID(),LOOT_FISHINGHOLE);
- player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT, ok->GetGOInfo()->id);
- SetLootState(GO_JUST_DEACTIVATED);
+ // prevent removing GO at spell cancel
+ player->RemoveGameObject(this,false);
+ SetOwnerGUID(player->GetGUID());
+
+ //TODO: find reasonable value for fishing hole search
+ GameObject* ok = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE);
+ if (ok)
+ {
+ player->SendLoot(ok->GetGUID(),LOOT_FISHINGHOLE);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT, ok->GetGOInfo()->id);
+ SetLootState(GO_JUST_DEACTIVATED);
+ }
+ else
+ player->SendLoot(GetGUID(),LOOT_FISHING);
}
- else
- player->SendLoot(GetGUID(),LOOT_FISHING);
}
break;
}