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, 09:55 PM
Mortow's Avatar
Mortow
Hill Giant
 
Join Date: Apr 2013
Posts: 215
Default Fishing issue

Is anyone else experiencing a problem with fishing? I have tried multiple zones, multiple fishing rods and different kinds of bait and it always tells me, 'Trying to catch land sharks perhaps?' even when I am levitating over a huge body of water. It was working a few days ago and all I have changed are some trade skill recipes. (UF client)
Reply With Quote
  #2  
Old 09-11-2014, 10:09 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
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
  #3  
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
  #4  
Old 09-11-2014, 11:29 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default

Okay, feel free to comment back with a screenshot or whatever of the information the debug sends you (I assume you removed the // in front of the Message to allow it to send?).
Reply With Quote
  #5  
Old 09-12-2014, 12:32 AM
Coenxai's Avatar
Coenxai
Hill Giant
 
Join Date: Dec 2013
Posts: 151
Default

I believe KLS recently made a change to FindBestZ. That could be a possibility to the issue you're facing.
Reply With Quote
  #6  
Old 09-12-2014, 02:38 PM
Mortow's Avatar
Mortow
Hill Giant
 
Join Date: Apr 2013
Posts: 215
Default

I enabled the message as you suggested, Kingly and it says:

Rod is at 1455.046, 1.128, -122.000, InWater says 0, InLava says 0

This attempt was done in PoK in the small pool by the fishing vendors.

I also changed the + 4 to - 1 and recompiled and this makes fishing work again. Not sure what affects that may have on other things.
Reply With Quote
  #7  
Old 09-12-2014, 04:50 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

The issue is the old code basically relied on the water's surface acting as a solid "floor".

If you look at the code what it does is cast out z + 10 above you and tries to find the bestz (hoping to hit the water surface). It then subtracts a small amount and hopes that the bobber is in the water.

I have the info in the maps to fix this so they don't have to be regenerated but it's not currently coded in.

For now the "RodZ = zone->zonemap->FindBestZ(dest, nullptr) + 4;" hack makes it work for *most* pools of water but I need to go back and recode the maps so we can do it as intended.
Reply With Quote
  #8  
Old 09-12-2014, 08:53 PM
Mortow's Avatar
Mortow
Hill Giant
 
Join Date: Apr 2013
Posts: 215
Default

Thanks for the info KLS. I must just have really bad luck in picking the pools because the four I used didn't work. That's the way my luck generally runs though.
Reply With Quote
  #9  
Old 10-14-2014, 11:15 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

I just ran into this on my server. So what is the real fix? Can I just run azone2 again on my maps and will that fix the problem or am I going to have to hack my code?
Reply With Quote
Reply


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 04:32 AM.


 

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