-
Angry Penguin
v4 is the current object.
Granted; the following is still a little screwy; it's more complete:
Code:
signed int __cdecl EnumVisibleObjects(int (__cdecl *pCallback)(WGUID, eWOWOBJECTTYPE), eWOWOBJECTTYPE filter)
{
WoWObject *firstObj; // eax@1
SObjectManager *objMgr; // esi@1
WoWObject *curObj; // ebx@3
eWOWOBJECTTYPE filter1; // edi@5
objMgr = *(SObjectManager **)(*MK_FP(__FS__, 44) + 4 * TlsIndex);
firstObj = objMgr->ObjectList->FirstObject;
if ( !((_BYTE)firstObj & 1) && firstObj )
curObj = objMgr->ObjectList->FirstObject;
else
curObj = 0;
filter1 = filter;
while ( !((_BYTE)curObj & 1) && curObj )
{
if ( !((int (__cdecl *)(_DWORD, _DWORD, _DWORD))pCallback)(curObj->Guid.dwLow, curObj->Guid.dwHigh, filter1) )
return 0;
curObj = *(WoWObject **)((char *)&curObj->Entry + (unsigned int)objMgr->ObjectList->NextObject);
}
return 1;
}
-
Post Thanks / Like - 1 Thanks
lsjaf3297 (1 members gave Thanks to Apoc for this useful post)
-
Member
Thanks. This explains the behaviour.
+rep to both of you!
Side question: what is the better coding style if you are in-process. Reading the objects manually or calling functions like "EnumVisibleObjects"?
-
Elite User
Originally Posted by
Ellesar1
Thanks. This explains the behaviour.
+rep to both of you!
Side question: what is the better coding style if you are in-process. Reading the objects manually or calling functions like "EnumVisibleObjects"?
Calling EnumVisibleObjects requires much less work!
[16:15:41] Cypher: caus the CPU is a dick
[16:16:07] kynox: CPU is mad
[16:16:15] Cypher: CPU is all like
[16:16:16] Cypher: whatever, i do what i want
-
Active Member
Thanks, very helpfull.
signed int __cdecl EnumVisibleObjects(int (__cdecl *pCallback)(WGUID, eWOWOBJECTTYPE), eWOWOBJECTTYPE filter)
eWOWOBJECTTYPE is an integer, representing a certain object type, for example ... 7 = dynamic object, correct ?
-
Elite User
Originally Posted by
flo8464
Thanks, very helpfull.
eWOWOBJECTTYPE is an integer, representing a certain object type, for example ... 7 = dynamic object, correct ?
It's using the object type flags.
http://www.mmowned.com/forums/wow-me...ructs-etc.html
It's the enum called "WoWObjectTypeFlag" - you can combine the flags obviously.
EDIT: Pass 0 to enumerate every object.
[16:15:41] Cypher: caus the CPU is a dick
[16:16:07] kynox: CPU is mad
[16:16:15] Cypher: CPU is all like
[16:16:16] Cypher: whatever, i do what i want
-
Kynox's Sister's Pimp
EnumVisibleObjects sucks. True story.
-
Elite User
Originally Posted by
Cypher
EnumVisibleObjects sucks. True story.
You suck. True story.
[16:15:41] Cypher: caus the CPU is a dick
[16:16:07] kynox: CPU is mad
[16:16:15] Cypher: CPU is all like
[16:16:16] Cypher: whatever, i do what i want
-
Kynox's Sister's Pimp
Originally Posted by
MaiN
You suck. True story.
You fail at life.
-
Active Member
Originally Posted by
Ellesar1
what do you understand with "walking backwards"? There is only a next - pointer, not a previous-pointer, as far as I know.
And they have to be initialized to 0 since an invalid pointer can be everything random (also even number!)
[ObjPtr+0x24] - 0x24 = PrevObjPtr
-
Active Member
And the pointer to the last object from the object manager..?
-
Active Member
Originally Posted by
lanman92
And the pointer to the last object from the object manager..?
it doesn't matter, using this method when you pass the first object in the object list the PrevObjPtr will loop around to the last object in the object list.