Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2014, 10:09 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,604
Default

Not sure what your exact issue is, but here's the Client::CanFish code in forage.cpp, the code giving your error is green. Maybe you could un-comment the yellow and recompile and see what it sends you?:
Code:
bool Client::CanFish() {
    //make sure we still have a fishing pole on:
    const ItemInst* Pole = m_inv[MainPrimary];
    int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal);
    const ItemInst* Bait = nullptr;
    if (bslot != INVALID_INDEX)
        Bait = m_inv.GetItem(bslot);

    if(!Pole || !Pole->IsType(ItemClassCommon) || Pole->GetItem()->ItemType != ItemTypeFishingPole) {
        if (m_inv.HasItemByUse(ItemTypeFishingPole, 1, invWhereWorn|invWherePersonal|invWhereBank|invWhereSharedBank|invWhereTrading|invWhereCursor))    //We have a fishing pole somewhere, just not equipped
            Message_StringID(MT_Skills, FISHING_EQUIP_POLE);    //You need to put your fishing pole in your primary hand.
        else    //We don't have a fishing pole anywhere
            Message_StringID(MT_Skills, FISHING_NO_POLE);    //You can't fish without a fishing pole, go buy one.
        return false;
    }

    if (!Bait || !Bait->IsType(ItemClassCommon) || Bait->GetItem()->ItemType != ItemTypeFishingBait) {
        Message_StringID(MT_Skills, FISHING_NO_BAIT);    //You can't fish without fishing bait, go buy some.
        return false;
    }

    if(zone->zonemap != nullptr && zone->watermap != nullptr && RuleB(Watermap, CheckForWaterWhenFishing)) {
        float RodX, RodY, RodZ;
        // Tweak Rod and LineLength if required
        const float RodLength = RuleR(Watermap, FishingRodLength);
        const float LineLength = RuleR(Watermap, FishingLineLength);
        int HeadingDegrees;

        HeadingDegrees = (int) ((GetHeading()*360)/256);
        HeadingDegrees = HeadingDegrees % 360;

        RodX = x_pos + RodLength * sin(HeadingDegrees * M_PI/180.0f);
        RodY = y_pos + RodLength * cos(HeadingDegrees * M_PI/180.0f);

        // Do BestZ to find where the line hanging from the rod intersects the water (if it is water).
        // and go 1 unit into the water.
        Map::Vertex dest;
        dest.x = RodX;
        dest.y = RodY;
        dest.z = z_pos+10;

        RodZ = zone->zonemap->FindBestZ(dest, nullptr) - 1;
        bool in_lava = zone->watermap->InLava(RodX, RodY, RodZ);
        bool in_water = zone->watermap->InWater(RodX, RodY, RodZ) || zone->watermap->InVWater(RodX, RodY, RodZ);
        //Message(0, "Rod is at %4.3f, %4.3f, %4.3f, InWater says %d, InLava says %d", RodX, RodY, RodZ, in_water, in_lava);
        if (in_lava) {
            Message_StringID(MT_Skills, FISHING_LAVA);    //Trying to catch a fire elemental or something?
            return false;
        }
        if((!in_water) || (z_pos-RodZ)>LineLength) {    //Didn't hit the water OR the water is too far below us
            Message_StringID(MT_Skills, FISHING_LAND);    //Trying to catch land sharks perhaps?
            return false;
        }
    }
    return true;
}
Reply With Quote
  #2  
Old 09-11-2014, 10:21 PM
Mortow's Avatar
Mortow
Hill Giant
 
Join Date: Apr 2013
Posts: 215
Default

I will give that a shot. Thanks Kingly. I don't have any levitate on and if I step in the water it tells me I must be on dry land to fish but when I take a step back out of the water, I get the land shark message. It is almost as if it is not recognizing the water as water.

EDIT: I compared your code above to my forage.cpp file which has a date of 09/08/2014 and the only difference I see is the line three lines above the Message you told me to uncomment. Mine had + 4 at the end instead of - 1. (Recompiling as I type this.)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:31 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3