diff --git a/src/control/Script.cpp b/src/control/Script.cpp index abcb29bc..f13375ef 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -7298,7 +7298,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) case COMMAND_WARP_CHAR_FROM_CAR_TO_COORD: { CollectParameters(&m_nIp, 4); - CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); + CPed *pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); CVector pos = *(CVector*)&ScriptParams[1]; if (pos.z <= MAP_Z_LOW_LIMIT) @@ -10655,7 +10655,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CVector pos = *(CVector*)&ScriptParams[0]; if (pos.z <= MAP_Z_LOW_LIMIT) pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); - CCoronas::RegisterCorona((uint32)this + m_nIp, ScriptParams[6], ScriptParams[7], ScriptParams[8], 255, pos, *(float*)&ScriptParams[3], + CCoronas::RegisterCorona((uintptr)this + m_nIp, ScriptParams[6], ScriptParams[7], ScriptParams[8], 255, pos, *(float*)&ScriptParams[3], 150.0f, ScriptParams[4], ScriptParams[5], 1, 0, 0, 0.0f, false, 0.2f); return 0; } diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 0ce8b50e..985b28c9 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -1449,7 +1449,8 @@ CStreaming::StreamVehiclesAndPeds(void) timeBeforeNextLoad--; else if(ms_numVehiclesLoaded <= desiredNumVehiclesLoaded){ CZoneInfo zone; - CTheZones::GetZoneInfoForTimeOfDay(&FindPlayerCoors(), &zone); + CVector coors = FindPlayerCoors(); + CTheZones::GetZoneInfoForTimeOfDay(&coors, &zone); int32 maxReq = -1; int32 mostRequestedRating = 0; for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){ diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp index 0e8606f3..84b5ca29 100644 --- a/src/core/Zones.cpp +++ b/src/core/Zones.cpp @@ -725,17 +725,17 @@ CTheZones::LoadAllZones(uint8 *buffer, uint32 size) for(i = 0; i < ARRAY_SIZE(NavigationZoneArray); i++){ NavigationZoneArray[i] = ReadSaveBuf(buffer); - NavigationZoneArray[i].child = GetPointerForZoneIndex((int32)NavigationZoneArray[i].child); - NavigationZoneArray[i].parent = GetPointerForZoneIndex((int32)NavigationZoneArray[i].parent); - NavigationZoneArray[i].next = GetPointerForZoneIndex((int32)NavigationZoneArray[i].next); + NavigationZoneArray[i].child = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].child); + NavigationZoneArray[i].parent = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].parent); + NavigationZoneArray[i].next = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].next); } for(i = 0; i < ARRAY_SIZE(InfoZoneArray); i++){ InfoZoneArray[i] = ReadSaveBuf(buffer); - InfoZoneArray[i].child = GetPointerForZoneIndex((int32)InfoZoneArray[i].child); - InfoZoneArray[i].parent = GetPointerForZoneIndex((int32)InfoZoneArray[i].parent); - InfoZoneArray[i].next = GetPointerForZoneIndex((int32)InfoZoneArray[i].next); + InfoZoneArray[i].child = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].child); + InfoZoneArray[i].parent = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].parent); + InfoZoneArray[i].next = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].next); } for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++) diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp index c24be62f..6fb858f6 100644 --- a/src/peds/CopPed.cpp +++ b/src/peds/CopPed.cpp @@ -257,7 +257,7 @@ CCopPed::ArrestPlayer(void) CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ARREST_GUN, 4.0f); CVector suspMidPos; - suspect->m_pedIK.GetComponentPosition((RwV3d)suspMidPos, PED_MID); + suspect->m_pedIK.GetComponentPosition(*(RwV3d *)&suspMidPos, PED_MID); m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(suspMidPos.x, suspMidPos.y, GetPosition().x, GetPosition().y); diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp index 95811dab..1988366d 100644 --- a/src/peds/EmergencyPed.cpp +++ b/src/peds/EmergencyPed.cpp @@ -231,8 +231,8 @@ CEmergencyPed::MedicAI(void) if (nearestAccident) { m_pRevivedPed = nearestAccident->m_pVictim; m_pRevivedPed->RegisterReference((CEntity**)&m_pRevivedPed); - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD); SetSeek((headPos + midPos) * 0.5f, 1.0f); SetObjective(OBJECTIVE_NONE); bIsRunning = true; @@ -271,8 +271,8 @@ CEmergencyPed::MedicAI(void) m_nEmergencyPedState = EMERGENCY_PED_STOP; break; } - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD); SetSeek((headPos + midPos) * 0.5f, nearestAccident->m_nMedicsPerformingCPR * 0.5f + 1.0f); SetObjective(OBJECTIVE_NONE); bIsRunning = true; @@ -326,8 +326,8 @@ CEmergencyPed::MedicAI(void) if (!m_pRevivedPed || m_pRevivedPed->m_fHealth > 0.0f) m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE; else { - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD); midPos = (headPos + midPos) * 0.5f; m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( midPos.x, midPos.y, @@ -348,8 +348,8 @@ CEmergencyPed::MedicAI(void) m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE; break; } - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); - m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID); + m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD); midPos = (headPos + midPos) * 0.5f; m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( midPos.x, midPos.y, diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 2c515428..691b5195 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -9714,7 +9714,7 @@ CPed::MoveHeadToLook(void) } if (m_pLookTarget->IsPed()) { - ((CPed*)m_pLookTarget)->m_pedIK.GetComponentPosition((RwV3d)lookPos, PED_MID); + ((CPed*)m_pLookTarget)->m_pedIK.GetComponentPosition(*(RwV3d *)&lookPos, PED_MID); } else { lookPos = m_pLookTarget->GetPosition(); } @@ -12805,7 +12805,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg) } // --MIAMI: Done, but enumarate weapon slots -inline void +void CPed::ReplaceWeaponWhenExitingVehicle(void) { eWeaponType weaponType = GetWeapon()->m_eWeaponType; @@ -12822,7 +12822,7 @@ CPed::ReplaceWeaponWhenExitingVehicle(void) } // --MIAMI: Done -inline void +void CPed::RemoveWeaponWhenEnteringVehicle(void) { if (IsPlayer() && HasWeaponSlot(5) && GetWeapon(5).m_nAmmoTotal > 0 && ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed()->m_bDriveByAllowed) { @@ -13677,7 +13677,7 @@ CPed::ProcessObjective(void) CVector target; CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f); if (m_pedInObjective->IsPed()) - m_pedInObjective->m_pedIK.GetComponentPosition((RwV3d)target, PED_MID); + m_pedInObjective->m_pedIK.GetComponentPosition(*(RwV3d *)&target, PED_MID); else target = m_pedInObjective->GetPosition(); @@ -18685,4 +18685,4 @@ IsPedPointerValid(CPed* pPed) if (pPed->bInVehicle && pPed->m_pMyVehicle) return IsEntityPointerValid(pPed->m_pMyVehicle); return pPed->m_entryInfoList.first || pPed == FindPlayerPed(); -} \ No newline at end of file +} diff --git a/src/peds/PedAttractor.cpp b/src/peds/PedAttractor.cpp index 782d2770..3d35b8a3 100644 --- a/src/peds/PedAttractor.cpp +++ b/src/peds/PedAttractor.cpp @@ -108,7 +108,7 @@ const C2dEffect* CPedAttractorManager::GetEffectForIceCreamVan(CVehicle* pVehicl CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect) { if (vVehicleToEffect.empty()) - return false; + return nil; for (std::vector::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) { if (assoc->HasThisEffect(pEffect)) return assoc->GetVehicle(); @@ -625,7 +625,7 @@ CPedAttractor* CPedAttractorManager::RegisterPed(CPed* pPed, C2dEffect* pEffect, ComputeEffectPos(pAttractor->GetEffect(), matrix, vEffectPos); if (pAttractor->GetEffect() == pEffect && vEffectPos == pAttractor->GetEffectPos()) { if (!IsApproachable(pEffect, matrix, pAttractor->ComputeFreeSlot(), pPed)) - return false; + return nil; pRegisteredAttractor = pAttractor; break; } diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index 37a0b191..aafb80c7 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1252,7 +1252,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed) #else CVector markPos; if (m_pPointGunAt->IsPed()) { - ((CPed*)m_pPointGunAt)->m_pedIK.GetComponentPosition((RwV3d)markPos, PED_MID); + ((CPed*)m_pPointGunAt)->m_pedIK.GetComponentPosition(*(RwV3d *)&markPos, PED_MID); } else { markPos = m_pPointGunAt->GetPosition(); } diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp index ab94f874..28156c7e 100644 --- a/src/render/Timecycle.cpp +++ b/src/render/Timecycle.cpp @@ -175,7 +175,7 @@ CTimeCycle::Initialise(void) bi++; bi++; } - while(work_buff[bi] != '\n') + while(work_buff[bi] != '\n' || work_buff[bi] != '\0') line[li++] = work_buff[bi++]; line[li] = '\0'; bi++; diff --git a/src/save/GenericGameStorage.h b/src/save/GenericGameStorage.h index b913c305..2d83385b 100644 --- a/src/save/GenericGameStorage.h +++ b/src/save/GenericGameStorage.h @@ -1,5 +1,6 @@ #pragma once +#include "Game.h" #include "PCSave.h" #define SLOT_COUNT (8) @@ -40,4 +41,4 @@ extern uint32 TimeToStayFadedBeforeFadeOut; extern char SaveFileNameJustSaved[260]; // 8F2570 -const char TopLineEmptyFile[] = "THIS FILE IS NOT VALID YET"; \ No newline at end of file +const char TopLineEmptyFile[] = "THIS FILE IS NOT VALID YET"; diff --git a/src/weapons/ShotInfo.cpp b/src/weapons/ShotInfo.cpp index f09ae052..6fc6341d 100644 --- a/src/weapons/ShotInfo.cpp +++ b/src/weapons/ShotInfo.cpp @@ -128,4 +128,4 @@ CShotInfo::Update() if (!((CTimer::GetFrameCounter() + slot) & 3)) CWorld::SetCarsOnFire(shot.m_startPos.x, shot.m_startPos.y, shot.m_startPos.z, 4.0f, shot.m_sourceEntity); } -} \ No newline at end of file +} diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 9edb3c51..eaf86bfc 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -817,7 +817,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) CPed *threatAttack = (CPed*)shooterPed->m_pPointGunAt; if ( threatAttack->IsPed() ) { - threatAttack->m_pedIK.GetComponentPosition((RwV3d)target, PED_MID); + threatAttack->m_pedIK.GetComponentPosition(*(RwV3d *)&target, PED_MID); threatAttack->ReactToPointGun(shooter); } else @@ -1483,7 +1483,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) { CVector pos; if (shooterPed->m_pPointGunAt->IsPed()) { - ((CPed*)shooterPed->m_pPointGunAt)->m_pedIK.GetComponentPosition((RwV3d)pos, PED_MID); + ((CPed*)shooterPed->m_pPointGunAt)->m_pedIK.GetComponentPosition(*(RwV3d *)&pos, PED_MID); } else { pos = ((CPed*)shooterPed->m_pPointGunAt)->GetPosition(); } diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp index 104fa2ec..bd53d8c5 100644 --- a/src/weapons/WeaponInfo.cpp +++ b/src/weapons/WeaponInfo.cpp @@ -59,7 +59,8 @@ static char ms_aWeaponNames[][32] = { }; CWeaponInfo* -CWeaponInfo::GetWeaponInfo(eWeaponType weaponType) { +CWeaponInfo::GetWeaponInfo(eWeaponType weaponType) +{ return &CWeaponInfo::ms_apWeaponInfos[weaponType]; } diff --git a/src/weapons/WeaponInfo.h b/src/weapons/WeaponInfo.h index 41450047..e7013004 100644 --- a/src/weapons/WeaponInfo.h +++ b/src/weapons/WeaponInfo.h @@ -1,5 +1,6 @@ #pragma once +#include "AnimManager.h" #include "AnimationId.h" #include "WeaponType.h"