a small C++ problem :)

a small C++ problem :)

Hi, everyone.

i have a struct like that

template
struct KODATA {
T* PreviousData;
DWORD Unknown;
T* NextData;
DWORD DataID;
T Data;
// sizeof(T)
};

it's working but when i use with this function

template
void GetKoStructEx(DWORD* IDPtr, KODATA** ListPtr) {
__asm {
mov edi,A
push IDPtr
push ListPtr
lea ecx,[edi+0x14]
call B
}

}

with something like

#define GetSkillStructEx(a, b) GetKoStructEx(a, b)
#define GetItemStructEx(a, b) GetKoStructEx(a, b)

i got these error's and i cannot solve them (arguments is really true)

MY USAGE:

KODATA* req;
GetItemStructEx(&skill->Data.needItem, &req);

data.needItem is DWORD so i am converting to pointer DWORD*

req is pointer to a struct but the function requires pointer to pointer to struct.

everything is OK. but ...

ERRORS:

1>.\\skill_atack.cpp(18): error: no instance of function template "GetKoStructEx" matches the argument list
1> argument types are: (DWORD *, KODATA **)
1> GetItemStructEx(&skill->Data.needItem, &req);
1> ^
1>
1>.\\skill_atack.cpp(19): error: no instance of function template "GetKoStructEx" matches the argument list
1> argument types are: (DWORD *, KODATA **)
1> GetKoStructEx(&skill->Data.needItem, &req);

.. and others :)

any small help from proffosional mans are welcome :), also i am using least version of intel compiler 11.. .60 with TBB liblary. also my function that requires the func.

void singleTimeSkill(KODATA*& skill, KODATA* target, BOOL showTarget = FALSE) {
atackTimerCheck.lock();
// --/-- global item check
if (itemCheck && skill->Data.needItem!=0 && isItOnInv(skill->Data.needItem)) {
KODATA* req;
GetItemStructEx(&skill->Data.needItem, &req);
GetKoStructEx(&skill->Data.needItem, &req);
//GetKoStructEx(&skill->Data.needItem, &req);
if (req->DataID) cout << "\\t You don't have " << req->Data.Name.Str << " to cast " << skill->Data.Name.Str << "." << endl;
else cout << "\\t Fatal error while casting skill." << endl;
atackTimerCheck.unlock();
return ;
}
// --/-- global mana check
if (manaCheck && (ADDR_CHR->mp < skill->Data.usedMp)) {
cout << "\\t No mana to cast " << skill->Data.Name.Str << " skill." << endl;
atackTimerCheck.unlock();
return ;
}
if (skill->Data.smType==6) {
cout << "\\t Casting " << skill->Data.Name.Str << " to party." << endl;
if (skill->Data.packetType!=0) pack.skillCast_1coord(ADDR_CHR->charId, 0xFFFF, skill->Data.ID, skill->Data.packetType, ADDR_CHR->mapCoord.x, ADDR_CHR->mapCoord.y);
pack.skillEffecting_3(ADDR_CHR->charId, 0xFFFF, skill->Data.ID);
} else if(skill->Data.smType==1) {
cout << "\\t Casting " << skill->Data.Name.Str << " to yourself." << endl;
if (skill->Data.packetType!=0) pack.skillCast_1coord(ADDR_CHR->charId, ADDR_CHR->charId, skill->Data.ID, skill->Data.packetType, ADDR_CHR->mapCoord.x, ADDR_CHR->mapCoord.y);
pack.skillEffecting_3(ADDR_CHR->charId, ADDR_CHR->charId, skill->Data.ID);
} else /*if (skill->Data.smType==7 || skill->Data.smType==2)*/ {
if (showTarget && oldTarget!=target->charId) {
SetConsoleTextAttribute( hConsole, 0xD );
cout << endl << "\\tTarget: " << target->charName.Str << " " << target->charId << endl;
oldTarget=target->charId;
}
SetConsoleTextAttribute( hConsole, 0x8 );
cout << "\\t Casting " << skill->Data.Name.Str << " skill to " << target->charId << endl;
if (skill->Data.packetType!=0) {
pack.skillCast_1coord(ADDR_CHR->charId, target->charId, skill->Data.ID, skill->Data.packetType, ADDR_CHR->mapCoord.x, ADDR_CHR->mapCoord.y);
if (skill->Data.otherTbl==2) pack.skillFly_2(0xFFFF, target->charId, skill->Data.ID);
}
pack.skillEffecting_3(ADDR_CHR->charId, target->charId, skill->Data.ID);
if (skill->Data.packetType!=0) pack.skillFail_4coord(ADDR_CHR->charId, target->charId, skill->Data.ID, target->mapCoord.x, target->mapCoord.y);
}
atackTimerCheck.unlock();
}

Best Regards,

Burak TAMTURK

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.