Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ALL Reversed by Bitwise
- // EDIT: Valid seed address: 0x82539084
- // EDIT2: Address in Memory: 0x820E31F8
- float random(int iSeed)
- {
- int ran = (*(int*)iSeed * 0x343FD) + 0x279EC3;
- *(int*)iSeed = ran;
- return float(ran >> 0x11) * 0.000031;
- }
- #define fViewKickPitchLerp(iSeed, ads, weapDef) (random(iSeed) * ads ? (*(float*)(weapDef + 0x4A8) - *(float*)(weapDef + 0x4AC)) : (*(float*)(weapDef + 0x4EC) - *(float*)(weapDef + 0x4F0))) + ads ? *(float*)(weapDef + 0x4A8) : *(float*)(weapDef + 0x4EC)
- #define fViewKickYawLerp(iSeed, ads, weapDef) (random(iSeed) * ads ? (*(float*)(weapDef + 0x4B0) - *(float*)(weapDef + 0x4B4)) : (*(float*)(weapDef + 0x4F4) - *(float*)(weapDef + 0x4F8))) + ads ? *(float*)(weapDef + 0x4F4) : *(float*)(weapDef + 0x4B0)
- #define fGunKickPitchLerp(iSeed, ads, weapDef) (random(iSeed) * ads ? (*(float*)(weapDef + 0x488) - *(float*)(weapDef + 0x48C)) : (*(float*)(weapDef + 0x4CC) - *(float*)(weapDef + 0x4D0)) + ads ? *(float*)(weapDef + 0x488) : *(float*)(weapDef + 0x4CC)
- #define fGunKickYawLerp(iSeed, ads, weapDef) (random(iSeed) * ads ? (*(float*)(weapDef + 0x490) - *(float*)(weapDef + 0x494)) : (*(float*)(weapDef + 0x4D4) - *(float*)(weapDef + 0x4D8)) + ads ? *(float*)(weapDef + 0x490) : *(float*)(weapDef + 0x4D4)
- void BG_WeaponFireRecoil(playerState_s *ps, float*vGunSpeed, float*kickAVel, int iSeed, bool weapState)
- {
- int weapDef = 0x8255A320 + (ps->weapCommon.weapFlags & 0x2 ? ps->weapCommon.offHandIndex * 4 : ps->weapCommon.weapon * 4);
- bool ads = ps->weapCommon.fWeaponPosFrac == 1.0;
- float fKickReducedKickPercent = ps->weapState[weapState].weaponRestrictKickTime <= 0 ? 1.0 : ps->weapCommon.fWeaponPosFrac != 1.0 ? *(float*)(weapDef + 0x4C8) : *(float*)(weapDef + 0x484), // if player is not fully ADS, use hip kick, else use ADS
- fRecoilScale = fKickReducedKickPercent * 0.0099999998;
- if(ps->weapCommon.weapFlags & 0x400){fRecoilScale *= (float)ps->recoilScale * 0.0099999998;}
- kickAVel[0] = -((fViewKickPitchLerp(iSeed, ads, weapDef) * fRecoilScale) * ps->weapCommon.weapFlags & 0x200 ? 5.0 : 0.0);
- kickAVel[1] = fViewKickYawLerp(iSeed, ads, weapDef) * fRecoilScale;
- kickAVel[2] = kickAVel[1] * -0.5;
- vGunSpeed[0] += ((fGunKickPitchLerp(iSeed, ads, weapDef) * fRecoilScale) * ps->weapCommon.weapFlags & 0x200 ? 5.0 : 0.0);
- vGunSpeed[1] += fGunKickYawLerp(iSeed, ads, weapDef) * fRecoilScale;
- }
Add Comment
Please, Sign In to add comment