mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-18 15:54:09 +00:00
Some CPed functions
Signed-off-by: eray orçunus <erayorcunus@gmail.com>
This commit is contained in:
parent
54837368c3
commit
ed69be36cc
4 changed files with 131 additions and 4 deletions
|
@ -11,6 +11,8 @@ void *CPed::operator new(size_t sz) { return CPools::GetPedPool()->New(); }
|
|||
void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); }
|
||||
|
||||
WRAPPER void CPed::KillPedWithCar(CVehicle *veh, float impulse) { EAXJMP(0x4EC430); }
|
||||
WRAPPER void CPed::Say(uint16 audio) { EAXJMP(0x4E5A10); }
|
||||
WRAPPER void CPed::SetLookFlag(CEntity* to, bool set) { EAXJMP(0x4C6460); }
|
||||
|
||||
static char ObjectiveText[34][28] = {
|
||||
"No Obj",
|
||||
|
@ -175,3 +177,56 @@ CPed::UseGroundColModel(void)
|
|||
m_nPedState == PED_DIE ||
|
||||
m_nPedState == PED_DEAD;
|
||||
}
|
||||
|
||||
void
|
||||
CPed::AddWeaponModel(int id)
|
||||
{
|
||||
RpAtomic* atm;
|
||||
|
||||
if (id != -1) {
|
||||
atm = (RpAtomic*)CModelInfo::GetModelInfo(id)->CreateInstance();
|
||||
RwFrameDestroy(RpAtomicGetFrame(atm));
|
||||
RpAtomicSetFrame(atm, m_pFrames[PED_HANDR]->frame);
|
||||
RpClumpAddAtomic((RpClump*)m_rwObject, atm);
|
||||
m_wepModelID = id;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPed::AimGun()
|
||||
{
|
||||
RwV3d pos;
|
||||
CVector vector;
|
||||
uint8 newFlag;
|
||||
|
||||
if (m_pSeekTarget) {
|
||||
if (m_pSeekTarget->m_status == STATUS_PHYSICS) {
|
||||
m_pSeekTarget->m_pedIK.GetComponentPosition(&pos, 1);
|
||||
vector.x = pos.x;
|
||||
vector.y = pos.y;
|
||||
vector.z = pos.z;
|
||||
} else {
|
||||
vector = *(m_pSeekTarget->GetMatrix().GetPosition());
|
||||
}
|
||||
CPed::Say(0x74);
|
||||
|
||||
m_ped_flagB40 = m_pedIK.PointGunAtPosition(&vector);
|
||||
if (m_pPedFight != m_pSeekTarget) {
|
||||
CPed::SetLookFlag(m_pSeekTarget, 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (CPed::IsPlayer()) {
|
||||
newFlag = m_pedIK.PointGunInDirection(m_fLookDirection, m_vecMoveSpeedAvg.y);
|
||||
} else {
|
||||
newFlag = m_pedIK.PointGunInDirection(m_fLookDirection, 0.0);
|
||||
}
|
||||
|
||||
m_ped_flagB40 = newFlag;
|
||||
}
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x4CF8F0, &CPed::AddWeaponModel, PATCH_JUMP);
|
||||
InjectHook(0x4C6AA0, &CPed::AimGun, PATCH_JUMP);
|
||||
ENDPATCHES
|
Loading…
Add table
Add a link
Reference in a new issue