diff options
author | aap <aap@papnet.eu> | 2020-04-08 16:36:53 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-04-08 18:45:55 +0200 |
commit | 9176aef1b251fe08d536f69e383334015c94e146 (patch) | |
tree | 27f3979748ae701790a87ce701a87a75c6d9f9a7 | |
parent | implemented CSkidmarks (diff) | |
parent | fix bug (diff) | |
download | re3-9176aef1b251fe08d536f69e383334015c94e146.tar re3-9176aef1b251fe08d536f69e383334015c94e146.tar.gz re3-9176aef1b251fe08d536f69e383334015c94e146.tar.bz2 re3-9176aef1b251fe08d536f69e383334015c94e146.tar.lz re3-9176aef1b251fe08d536f69e383334015c94e146.tar.xz re3-9176aef1b251fe08d536f69e383334015c94e146.tar.zst re3-9176aef1b251fe08d536f69e383334015c94e146.zip |
-rw-r--r-- | src/control/Garages.cpp | 4 | ||||
-rw-r--r-- | src/control/Script.cpp | 4 | ||||
-rw-r--r-- | src/core/Camera.cpp | 2 | ||||
-rw-r--r-- | src/render/Skidmarks.cpp | 10 | ||||
-rw-r--r-- | src/render/Skidmarks.h | 6 |
5 files changed, 14 insertions, 12 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 9e10af2d..84d49bee 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -1679,7 +1679,7 @@ float CGarage::CalcDistToGarageRectangleSquared(float X, float Y) else distX = 0.0f; if (Y < m_fY1) - distY = m_fY1 - X; + distY = m_fY1 - Y; else if (Y > m_fY2) distY = Y - m_fY2; else @@ -2358,4 +2358,4 @@ STARTPATCHES InjectHook(0x427AB0, CGarages::IsPointInAGarageCameraZone, PATCH_JUMP); // CCamera::CamControl InjectHook(0x427BC0, CGarages::CameraShouldBeOutside, PATCH_JUMP); // CCamera::CamControl InjectHook(0x428940, CGarages::Load, PATCH_JUMP); // GenericLoad -ENDPATCHES
\ No newline at end of file +ENDPATCHES diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 6b79265a..18572573 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -7117,7 +7117,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) case COMMAND_CLOSE_GARAGE: { CollectParameters(&m_nIp, 1); - CGarages::CloseGarage(ScriptParams[1]); + CGarages::CloseGarage(ScriptParams[0]); return 0; } case COMMAND_WARP_CHAR_FROM_CAR_TO_COORD: @@ -9141,7 +9141,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) assert(pVehicle); assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR); CAutomobile* pCar = (CAutomobile*)pVehicle; - pCar->bTakeLessDamage = ScriptParams[1]; + pCar->bMoreResistantToDamage = ScriptParams[1]; return 0; } case COMMAND_SET_JAMES_CAR_ON_PATH_TO_PLAYER: diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 0ffaed1a..00c838cf 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -1223,7 +1223,7 @@ CCamera::CamControl(void) ReqMode == CCam::MODE_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_M16_1STPERSON_RUNABOUT || ReqMode == CCam::MODE_FIGHT_CAM_RUNABOUT || ReqMode == CCam::MODE_HELICANNON_1STPERSON || WhoIsInControlOfTheCamera == CAMCONTROL_SCRIPT || - m_bJustCameOutOfGarage || m_bPlayerIsInGarage) + m_bJustCameOutOfGarage || m_bPlayerIsInGarage) canUseObbeCam = false; if(m_bObbeCinematicPedCamOn && canUseObbeCam) diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp index 87881fb9..41ee5d1d 100644 --- a/src/render/Skidmarks.cpp +++ b/src/render/Skidmarks.cpp @@ -8,8 +8,8 @@ CSkidmark CSkidmarks::aSkidmarks[NUMSKIDMARKS]; -RwImVertexIndex SkidmarkIndexList[16 * 6]; -RwIm3DVertex SkidmarkVertices[16 * 2]; +RwImVertexIndex SkidmarkIndexList[SKIDMARK_LENGTH * 6]; +RwIm3DVertex SkidmarkVertices[SKIDMARK_LENGTH * 2]; RwTexture *gpSkidTex; RwTexture *gpSkidBloodTex; RwTexture *gpSkidMudTex; @@ -32,7 +32,7 @@ CSkidmarks::Init(void) } ix = 0; - for(i = 0; i < 16; i++){ + for(i = 0; i < SKIDMARK_LENGTH; i++){ SkidmarkIndexList[i*6+0] = ix+0; SkidmarkIndexList[i*6+1] = ix+2; SkidmarkIndexList[i*6+2] = ix+1; @@ -42,7 +42,7 @@ CSkidmarks::Init(void) ix += 2; } - for(i = 0; i < 16; i++){ + for(i = 0; i < SKIDMARK_LENGTH; i++){ RwIm3DVertexSetU(&SkidmarkVertices[i*2 + 0], 0.0f); RwIm3DVertexSetV(&SkidmarkVertices[i*2 + 0], i*5.01f); 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(); - if(aSkidmarks[i].m_last >= 15){ + if(aSkidmarks[i].m_last >= SKIDMARK_LENGTH-1){ // No space to continue, end it aSkidmarks[i].m_state = 2; aSkidmarks[i].m_fadeStart = CTimer::GetTimeInMilliseconds() + 10000; diff --git a/src/render/Skidmarks.h b/src/render/Skidmarks.h index 5387d8f4..085b4c6d 100644 --- a/src/render/Skidmarks.h +++ b/src/render/Skidmarks.h @@ -1,5 +1,7 @@ #pragma once +enum { SKIDMARK_LENGTH = 16 }; + class CSkidmark { public: @@ -12,8 +14,8 @@ public: uint32 m_lastUpdate;; uint32 m_fadeStart; uint32 m_fadeEnd; - CVector m_pos[16]; - CVector m_side[16]; + CVector m_pos[SKIDMARK_LENGTH]; + CVector m_side[SKIDMARK_LENGTH]; }; class CSkidmarks |