EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Problem with some custom code (Paging Zaela) (https://www.eqemulator.org/forums/showthread.php?t=38872)

Traul 10-07-2014 07:18 PM

Problem with some custom code (Paging Zaela)
 
So I tried to patch in Zaela's fix for others being able to see the Monk Epic graphic (found here) but I've come into a little snag. I made the exact changes that she said (but replaced ids and what not) as well as inserted this into client.h:

Code:

bool    MonkEpicEquipped() const;
But when I compile I get

Error 142 error C2601: 'Client::MonkEpicEquipped' : local function definitions are illegal C:\EQ\Source\zone\client.cpp 1903 1 zone
And
821 IntelliSense: member function "Client::MonkEpicEquipped" may not be redeclared outside its class c:\eq\source\zone\client.cpp 1902 14 zone

Referring to:
Code:

bool Client::MonkEpicEquipped() const
{
        if (GetClass() == MONK)
        {
                ItemInst* inst = GetInv().GetItem(12);
                if (inst && inst->GetItem()->ID == 10652)
                        return true;
        }
        return false;
}

What did I do wrong exactly??

Uleat 10-07-2014 07:33 PM

Did you declare inside of Client? Or is it in file scope?

You should declare somewhere between here and line 1210 (before 'protected:')

Traul 10-07-2014 08:19 PM

Quote:

Originally Posted by Uleat (Post 234560)
Did you declare inside of Client? Or is it in file scope?

You should declare somewhere between here and line 1210 (before 'protected:')

I have it placed in between line 227 and 228 on that link

scrubtasticx 10-07-2014 09:17 PM

sounds like there is a error in the definition of it.

jdoran 10-07-2014 09:18 PM

Hmm. 'redeclared' Search your project for another usage of that string.

Zaela_S 10-07-2014 09:30 PM

Quote:

Originally Posted by Traul (Post 234556)
local function definitions are illegal

Sounds like this error would only come up if you're trying to define a function in the body of another function. Misplaced '}' somewhere in the client.cpp part, probably.
edit: would explain why it complains about it being a redefinition too, different scope.

Traul 10-07-2014 09:51 PM

Quote:

Originally Posted by Zaela_S (Post 234566)
Sounds like this error would only come up if you're trying to define a function in the body of another function. Misplaced '}' somewhere in the client.cpp part, probably.
edit: would explain why it complains about it being a redefinition too, different scope.

God I'm dumb, this was exactly it. Works perfectly now, thanks for the great fix!

Uleat 10-08-2014 12:17 AM

Zaela definitely beat me to it :P

I put the declaration and definition in a clean repo and hit build..then laid down for a few hours... (it came up good)


All times are GMT -4. The time now is 11:54 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.