A simple LOOP question... really simply

Posts 16–21 of 21 · Page 2 of 2
Quote Originally Posted by giniyat101 View Post
so you made something like that:

Code:
void features(DWORD pWeapopnMgr, DWORD index)
{
    DWORD pWeapon = *(DWORD*)(pWeaponMgr+index*4);
    if (pWeapon)
    {
         //OHK
         *(FLOAT*)(pWeapon+0x7F8) = 99999.0f;
    }
    if (index == 0) return;
    features(pWeaponMgr, index-1);
}
and just called features(pWeaponMgr, 600);

really useless and will just fuck the stack, i dont suggest using it
exactly but i use global constant for the weapon mgr and i give only one argument the situation for no recoil and no knock back is a little bit more different
Quote Originally Posted by kmanev073 View Post
exactly but i use global constant for the weapon mgr and i give only one argument the situation for no recoil and no knock back is a little bit more different
stack will still fucked up as you push 2 values for each weapon (plus more for local variables)
Quote Originally Posted by giniyat101 View Post
stack will still fucked up as you push 2 values for each weapon (plus more for local variables)
lolo dude i just define the weapon MGR as global not in function then just send the amount of weapons to my func LOL
Quote Originally Posted by kmanev073 View Post
lolo dude i just define the weapon MGR as global not in function then just send the amount of weapons to my func LOL
yea but index and return address are still pushed so 600 * 2 = 1200 * 4 (DWORD size) = 4800 bytes (ignoring that the function itself will use sub esp, xx so it will be alot more)
Quote Originally Posted by giniyat101 View Post
yea but index and return address are still pushed so 600 * 2 = 1200 * 4 (DWORD size) = 4800 bytes (ignoring that the function itself will use sub esp, xx so it will be alot more)
thats why i think here should be return at the end not only at the if statement
umm,
i have a diferent form to ge all weapons stored at weaponmgr,
not have to change loop 600 or 700 anymore.
Posts 16–21 of 21 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us