mirror of
https://github.com/halpz/re3.git
synced 2025-07-03 01:30:45 +00:00
CPed, CVehicle, mostly entering/exiting car
Signed-off-by: eray orçunus <erayorcunus@gmail.com>
This commit is contained in:
@ -2,5 +2,7 @@
|
||||
#include "patcher.h"
|
||||
#include "CarCtrl.h"
|
||||
|
||||
int &CCarCtrl::NumLawEnforcerCars = *(int*)0x8F1B38;
|
||||
|
||||
WRAPPER void CCarCtrl::SwitchVehicleToRealPhysics(CVehicle*) { EAXJMP(0x41F7F0); }
|
||||
WRAPPER void CCarCtrl::AddToCarArray(int id, int vehclass) { EAXJMP(0x4182F0); }
|
||||
|
@ -7,4 +7,6 @@ class CCarCtrl
|
||||
public:
|
||||
static void SwitchVehicleToRealPhysics(CVehicle*);
|
||||
static void AddToCarArray(int id, int vehclass);
|
||||
|
||||
static int32 &NumLawEnforcerCars;
|
||||
};
|
||||
|
40
src/control/PedPlacement.cpp
Normal file
40
src/control/PedPlacement.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include "common.h"
|
||||
#include "patcher.h"
|
||||
#include "PedPlacement.h"
|
||||
#include "World.h"
|
||||
|
||||
void
|
||||
CPedPlacement::FindZCoorForPed(CVector* pos)
|
||||
{
|
||||
float zForPed;
|
||||
float startZ = pos->z - 100.0f;
|
||||
float foundColZ = -100.0f;
|
||||
float foundColZ2 = -100.0f;
|
||||
CColPoint foundCol;
|
||||
CEntity* foundEnt;
|
||||
|
||||
CVector vec(
|
||||
pos->x,
|
||||
pos->y,
|
||||
pos->z + 1.0f
|
||||
);
|
||||
|
||||
if (CWorld::ProcessVerticalLine(vec, startZ, foundCol, foundEnt, true, false, false, false, true, false, false))
|
||||
foundColZ = foundCol.point.z;
|
||||
|
||||
// Adjust coords and do a second test
|
||||
vec.x += 0.1f;
|
||||
vec.y += 0.1f;
|
||||
|
||||
if (CWorld::ProcessVerticalLine(vec, startZ, foundCol, foundEnt, true, false, false, false, true, false, false))
|
||||
foundColZ2 = foundCol.point.z;
|
||||
|
||||
zForPed = max(foundColZ, foundColZ2);
|
||||
|
||||
if (zForPed > -99.0f)
|
||||
pos->z = 1.04f + zForPed;
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x4EE340, &CPedPlacement::FindZCoorForPed, PATCH_JUMP);
|
||||
ENDPATCHES
|
8
src/control/PedPlacement.h
Normal file
8
src/control/PedPlacement.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
class CVector;
|
||||
|
||||
class CPedPlacement {
|
||||
public:
|
||||
static void FindZCoorForPed(CVector* pos);
|
||||
};
|
Reference in New Issue
Block a user