mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-13 23:44:09 +00:00
Phone start, ped spinning and cop car fix, and some love to CPed
Signed-off-by: eray orçunus <erayorcunus@gmail.com>
This commit is contained in:
parent
69ee4acc97
commit
86681c6f18
7 changed files with 191 additions and 9 deletions
|
@ -2,5 +2,42 @@
|
|||
#include "patcher.h"
|
||||
#include "Phones.h"
|
||||
|
||||
CPhoneInfo &gPhoneInfo = * (CPhoneInfo*) * (uintptr*)0x732A20;
|
||||
|
||||
int
|
||||
CPhoneInfo::FindNearestFreePhone(CVector *pos)
|
||||
{
|
||||
int nearestPhoneId = -1;
|
||||
float nearestPhoneDist = 60.0f;
|
||||
|
||||
for (int phoneId = 0; phoneId < m_nMax; phoneId++) {
|
||||
|
||||
if (gPhoneInfo.m_aPhones[phoneId].m_nState == 0) {
|
||||
float phoneDist = (m_aPhones[phoneId].m_vecPos - *pos).Magnitude2D();
|
||||
|
||||
if (phoneDist < nearestPhoneDist) {
|
||||
nearestPhoneDist = phoneDist;
|
||||
nearestPhoneId = phoneId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nearestPhoneId;
|
||||
}
|
||||
|
||||
bool
|
||||
CPhoneInfo::PhoneAtThisPosition(CVector pos)
|
||||
{
|
||||
for (int phoneId = 0; phoneId < m_nMax; phoneId++) {
|
||||
if (pos.x == m_aPhones[phoneId].m_vecPos.x && pos.y == m_aPhones[phoneId].m_vecPos.y)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x42F720, &CPhoneInfo::FindNearestFreePhone, PATCH_JUMP);
|
||||
InjectHook(0x42FD50, &CPhoneInfo::PhoneAtThisPosition, PATCH_JUMP);
|
||||
ENDPATCHES
|
||||
|
||||
WRAPPER void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x42F570); }
|
||||
WRAPPER void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x42F470); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue