All pastes #886409 Raw Edit

Something

public text v1 · immutable
#886409 ·published 2008-01-31 17:30 UTC
rendered paste body
unsigned int __thiscall CPed_SerializeForSaveInner(CPedSerializedData *this, CPed *ped)
{
  float *v2; // eax@1
  CPed *v3; // esi@1
  VECTOR *v4; // eax@2
  unsigned int result; // eax@4
  int v6; // edx@5
  unsigned int v7; // eax@8
  signed int v8; // edx@8

  v3 = ped;
  v2 = (float *)ped->Physical.Entity.Placeable.Matrix;
  if ( v2 )
    v4 = (VECTOR *)(v2 + 12);
  else
    v4 = (VECTOR *)&ped->Physical.Entity.Placeable.PositionX;
  this->X = v4->X;
  this->Y = v4->Y;
  this->Z = v4->Z;
  this->Health = v3->fHealth;
  this->Armour = v3->fArmour;
  this->ActorRef = v3->ActorRef;
  this->CurrentWeapon = v3->CurrentWeapon;
  this->ActiveInterior = v3->Physical.Entity.ActiveInterior;
  this->FightingStyle = v3->FightingStyle;
  this->FightingStyleType = v3->FightingStyleType;
  this->EnterExitIndex = -1;
  result = v3->EnterExitPoolItem;
  if ( result )
  {
    v6 = v3->EnterExitPoolItem;
    if ( *(_DWORD *)(result + 56) )                             // must be pointing to some sub item
      v6 = *(_DWORD *)(result + 56);
    if ( *(_BYTE *)(v6 + 50) )
    {
      v7 = result - *(_DWORD *)CPool_CEnterExit;
      v8 = (signed int)(v7 + ((unsigned __int64)(-2004318071i64 * (signed int)v7) >> 32)) >> 5;
      result = (unsigned int)(v7 + ((unsigned __int64)(-2004318071i64 * (signed int)v7) >> 32)) >> 31;
      this->EnterExitIndex = result + v8;                       // calculates and stores some CEnterExit index
    }
  }
  memcpy((char *)this + 20, (char *)v3 + 1440, 0x16Cu);         // Copy the weapon slots
  return result;
}