Log in

View Full Version : Problem with some custom code (Paging Zaela)


Traul
10-07-2014, 07:18 PM
So I tried to patch in Zaela's fix for others being able to see the Monk Epic graphic (found here (http://cdn.project1999.com/forums/showthread.php?t=60080&page=8)) 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:

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:
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 (https://github.com/EQEmu/Server/blob/master/zone/client.h#L209) and line 1210 (before 'protected:')

Traul
10-07-2014, 08:19 PM
Did you declare inside of Client? Or is it in file scope?

You should declare somewhere between here (https://github.com/EQEmu/Server/blob/master/zone/client.h#L209) 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
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
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)