summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornrb <email.com>2020-05-24 17:27:12 +0200
committernrb <email.com>2020-05-24 17:27:12 +0200
commitd59862eb5e9b56fe5b9fb0b2332e07b5266dcd22 (patch)
treecb26faa96123be56fe3bad98a6447ae5f476b11b /src
parenthow did saving even work in original III? (diff)
downloadre3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.tar
re3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.tar.gz
re3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.tar.bz2
re3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.tar.lz
re3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.tar.xz
re3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.tar.zst
re3-d59862eb5e9b56fe5b9fb0b2332e07b5266dcd22.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/Script.cpp5
-rw-r--r--src/core/Streaming.cpp3
-rw-r--r--src/core/Zones.cpp12
-rw-r--r--src/peds/CopPed.cpp2
-rw-r--r--src/peds/EmergencyPed.cpp16
-rw-r--r--src/peds/Ped.cpp10
-rw-r--r--src/peds/PedAttractor.cpp (renamed from src/peds/PedAttactor.cpp)4
-rw-r--r--src/peds/PlayerPed.cpp2
-rw-r--r--src/render/Timecycle.cpp2
-rw-r--r--src/save/GenericGameStorage.h3
-rw-r--r--src/weapons/ShotInfo.cpp2
-rw-r--r--src/weapons/Weapon.cpp4
-rw-r--r--src/weapons/WeaponInfo.cpp3
-rw-r--r--src/weapons/WeaponInfo.h1
14 files changed, 37 insertions, 32 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index cf2545c0..cbaaf32e 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11,6 +11,7 @@
#include "CarAI.h"
#include "CarCtrl.h"
#include "CarGen.h"
+#include "Ped.h"
#include "CivilianPed.h"
#include "Clock.h"
#include "ColStore.h"
@@ -7298,7 +7299,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 +10656,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<CZone>(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<CZone>(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..35acd675 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 7eb2491b..8f6cc284 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -9713,7 +9713,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();
}
@@ -12804,7 +12804,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
}
// --MIAMI: Done, but enumarate weapon slots
-inline void
+void
CPed::ReplaceWeaponWhenExitingVehicle(void)
{
eWeaponType weaponType = GetWeapon()->m_eWeaponType;
@@ -12821,7 +12821,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) {
@@ -13675,7 +13675,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();
@@ -18682,4 +18682,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/PedAttactor.cpp b/src/peds/PedAttractor.cpp
index 782d2770..3d35b8a3 100644
--- a/src/peds/PedAttactor.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<CVehicleToEffect>::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 c120c003..8846fdf0 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 ebdeb38b..6908abab 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"