From 26bbbe003761490d16a75e4f4e06199e8bc47b70 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 9 Feb 2021 20:02:29 +0100 Subject: [PATCH 1/2] fix clouds --- src/core/FileLoader.cpp | 1 + src/render/Clouds.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp index 4d1cd921..bf017256 100644 --- a/src/core/FileLoader.cpp +++ b/src/core/FileLoader.cpp @@ -317,6 +317,7 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname) buf += 4; if(model.numLines > 0){ //model.lines = (CColLine*)RwMalloc(model.numLines*sizeof(CColLine)); + REGISTER_MEMPTR(&model.lines); for(i = 0; i < model.numLines; i++){ //model.lines[i].Set(*(CVector*)buf, *(CVector*)(buf+12)); buf += 24; diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp index c7554356..e3a8c86e 100644 --- a/src/render/Clouds.cpp +++ b/src/render/Clouds.cpp @@ -265,8 +265,8 @@ CClouds::Render(void) for(i = 0; i < 37; i++){ RwV3d pos = { 2.0f*CoorsOffsetX[i], 2.0f*CoorsOffsetY[i], 40.0f*CoorsOffsetZ[i] + 40.0f }; - worldpos.x = campos.x*rot_cos + campos.y*rot_sin + pos.x; - worldpos.y = campos.x*rot_sin + campos.y*rot_cos + pos.y; + worldpos.x = pos.x*rot_cos + pos.y*rot_sin + campos.x; + worldpos.y = pos.x*rot_sin + pos.y*rot_cos + campos.y; worldpos.z = pos.z; if(bCloudOnScreen[i] && CSprite::CalcScreenCoors(worldpos, &screenpos, &szx, &szy, false)){ if(sundist < SCREEN_WIDTH/3){ From ca85e44c9e6aa0a21a637179b3cea6be66e08edb Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Wed, 10 Feb 2021 12:21:21 +0200 Subject: [PATCH 2/2] Fix repeating pickup sound on revenue pickup --- src/control/Pickups.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index 67e658c6..7bc88321 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -274,10 +274,11 @@ CPickup::CanBePickedUp(CPlayerPed *player, int playerId) { assert(m_pObject != nil); bool cannotBePickedUp = - (m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 0.5f) - || (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > CWorld::Players[playerId].m_nMaxHealth - 0.5f) + (m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 0.2f) + || (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > CWorld::Players[playerId].m_nMaxHealth - 0.2f) || (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->GetWantedLevel() == 0) - || (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame)); + || (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame)) + || (m_eType == PICKUP_ASSET_REVENUE && m_fRevenue < 10.0f); return !cannotBePickedUp; }