Merge branch 'master' of github.com:gtamodding/re3

This commit is contained in:
aap 2020-04-08 16:36:53 +02:00
commit 9176aef1b2
5 changed files with 14 additions and 12 deletions

View File

@ -1679,7 +1679,7 @@ float CGarage::CalcDistToGarageRectangleSquared(float X, float Y)
else else
distX = 0.0f; distX = 0.0f;
if (Y < m_fY1) if (Y < m_fY1)
distY = m_fY1 - X; distY = m_fY1 - Y;
else if (Y > m_fY2) else if (Y > m_fY2)
distY = Y - m_fY2; distY = Y - m_fY2;
else else
@ -2358,4 +2358,4 @@ STARTPATCHES
InjectHook(0x427AB0, CGarages::IsPointInAGarageCameraZone, PATCH_JUMP); // CCamera::CamControl InjectHook(0x427AB0, CGarages::IsPointInAGarageCameraZone, PATCH_JUMP); // CCamera::CamControl
InjectHook(0x427BC0, CGarages::CameraShouldBeOutside, PATCH_JUMP); // CCamera::CamControl InjectHook(0x427BC0, CGarages::CameraShouldBeOutside, PATCH_JUMP); // CCamera::CamControl
InjectHook(0x428940, CGarages::Load, PATCH_JUMP); // GenericLoad InjectHook(0x428940, CGarages::Load, PATCH_JUMP); // GenericLoad
ENDPATCHES ENDPATCHES

View File

@ -7117,7 +7117,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
case COMMAND_CLOSE_GARAGE: case COMMAND_CLOSE_GARAGE:
{ {
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CGarages::CloseGarage(ScriptParams[1]); CGarages::CloseGarage(ScriptParams[0]);
return 0; return 0;
} }
case COMMAND_WARP_CHAR_FROM_CAR_TO_COORD: case COMMAND_WARP_CHAR_FROM_CAR_TO_COORD:
@ -9141,7 +9141,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
assert(pVehicle); assert(pVehicle);
assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR); assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
CAutomobile* pCar = (CAutomobile*)pVehicle; CAutomobile* pCar = (CAutomobile*)pVehicle;
pCar->bTakeLessDamage = ScriptParams[1]; pCar->bMoreResistantToDamage = ScriptParams[1];
return 0; return 0;
} }
case COMMAND_SET_JAMES_CAR_ON_PATH_TO_PLAYER: case COMMAND_SET_JAMES_CAR_ON_PATH_TO_PLAYER:

View File

@ -1223,7 +1223,7 @@ CCamera::CamControl(void)
ReqMode == CCam::MODE_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_M16_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_M16_1STPERSON_RUNABOUT ||
ReqMode == CCam::MODE_FIGHT_CAM_RUNABOUT || ReqMode == CCam::MODE_HELICANNON_1STPERSON || ReqMode == CCam::MODE_FIGHT_CAM_RUNABOUT || ReqMode == CCam::MODE_HELICANNON_1STPERSON ||
WhoIsInControlOfTheCamera == CAMCONTROL_SCRIPT || WhoIsInControlOfTheCamera == CAMCONTROL_SCRIPT ||
m_bJustCameOutOfGarage || m_bPlayerIsInGarage) m_bJustCameOutOfGarage || m_bPlayerIsInGarage)
canUseObbeCam = false; canUseObbeCam = false;
if(m_bObbeCinematicPedCamOn && canUseObbeCam) if(m_bObbeCinematicPedCamOn && canUseObbeCam)

View File

@ -8,8 +8,8 @@
CSkidmark CSkidmarks::aSkidmarks[NUMSKIDMARKS]; CSkidmark CSkidmarks::aSkidmarks[NUMSKIDMARKS];
RwImVertexIndex SkidmarkIndexList[16 * 6]; RwImVertexIndex SkidmarkIndexList[SKIDMARK_LENGTH * 6];
RwIm3DVertex SkidmarkVertices[16 * 2]; RwIm3DVertex SkidmarkVertices[SKIDMARK_LENGTH * 2];
RwTexture *gpSkidTex; RwTexture *gpSkidTex;
RwTexture *gpSkidBloodTex; RwTexture *gpSkidBloodTex;
RwTexture *gpSkidMudTex; RwTexture *gpSkidMudTex;
@ -32,7 +32,7 @@ CSkidmarks::Init(void)
} }
ix = 0; ix = 0;
for(i = 0; i < 16; i++){ for(i = 0; i < SKIDMARK_LENGTH; i++){
SkidmarkIndexList[i*6+0] = ix+0; SkidmarkIndexList[i*6+0] = ix+0;
SkidmarkIndexList[i*6+1] = ix+2; SkidmarkIndexList[i*6+1] = ix+2;
SkidmarkIndexList[i*6+2] = ix+1; SkidmarkIndexList[i*6+2] = ix+1;
@ -42,7 +42,7 @@ CSkidmarks::Init(void)
ix += 2; ix += 2;
} }
for(i = 0; i < 16; i++){ for(i = 0; i < SKIDMARK_LENGTH; i++){
RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 0], 0.0f); RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 0], 0.0f);
RwIm3DVertexSetV(&SkidmarkVertices[i*2 + 0], i*5.01f); RwIm3DVertexSetV(&SkidmarkVertices[i*2 + 0], i*5.01f);
RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 1], 1.0f); RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 1], 1.0f);
@ -201,7 +201,7 @@ CSkidmarks::RegisterOne(uintptr id, CVector pos, float fwdX, float fwdY, bool *i
} }
aSkidmarks[i].m_lastUpdate = CTimer::GetTimeInMilliseconds(); aSkidmarks[i].m_lastUpdate = CTimer::GetTimeInMilliseconds();
if(aSkidmarks[i].m_last >= 15){ if(aSkidmarks[i].m_last >= SKIDMARK_LENGTH-1){
// No space to continue, end it // No space to continue, end it
aSkidmarks[i].m_state = 2; aSkidmarks[i].m_state = 2;
aSkidmarks[i].m_fadeStart = CTimer::GetTimeInMilliseconds() + 10000; aSkidmarks[i].m_fadeStart = CTimer::GetTimeInMilliseconds() + 10000;

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
enum { SKIDMARK_LENGTH = 16 };
class CSkidmark class CSkidmark
{ {
public: public:
@ -12,8 +14,8 @@ public:
uint32 m_lastUpdate;; uint32 m_lastUpdate;;
uint32 m_fadeStart; uint32 m_fadeStart;
uint32 m_fadeEnd; uint32 m_fadeEnd;
CVector m_pos[16]; CVector m_pos[SKIDMARK_LENGTH];
CVector m_side[16]; CVector m_side[SKIDMARK_LENGTH];
}; };
class CSkidmarks class CSkidmarks