fixed compiler errors

This commit is contained in:
nrb 2020-05-24 17:27:12 +02:00
parent 8705562559
commit d59862eb5e
14 changed files with 37 additions and 32 deletions

View file

@ -11,6 +11,7 @@
#include "CarAI.h" #include "CarAI.h"
#include "CarCtrl.h" #include "CarCtrl.h"
#include "CarGen.h" #include "CarGen.h"
#include "Ped.h"
#include "CivilianPed.h" #include "CivilianPed.h"
#include "Clock.h" #include "Clock.h"
#include "ColStore.h" #include "ColStore.h"
@ -10655,7 +10656,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
CVector pos = *(CVector*)&ScriptParams[0]; CVector pos = *(CVector*)&ScriptParams[0];
if (pos.z <= MAP_Z_LOW_LIMIT) if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); 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); 150.0f, ScriptParams[4], ScriptParams[5], 1, 0, 0, 0.0f, false, 0.2f);
return 0; return 0;
} }

View file

@ -1449,7 +1449,8 @@ CStreaming::StreamVehiclesAndPeds(void)
timeBeforeNextLoad--; timeBeforeNextLoad--;
else if(ms_numVehiclesLoaded <= desiredNumVehiclesLoaded){ else if(ms_numVehiclesLoaded <= desiredNumVehiclesLoaded){
CZoneInfo zone; CZoneInfo zone;
CTheZones::GetZoneInfoForTimeOfDay(&FindPlayerCoors(), &zone); CVector coors = FindPlayerCoors();
CTheZones::GetZoneInfoForTimeOfDay(&coors, &zone);
int32 maxReq = -1; int32 maxReq = -1;
int32 mostRequestedRating = 0; int32 mostRequestedRating = 0;
for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){ for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){

View file

@ -725,17 +725,17 @@ CTheZones::LoadAllZones(uint8 *buffer, uint32 size)
for(i = 0; i < ARRAY_SIZE(NavigationZoneArray); i++){ for(i = 0; i < ARRAY_SIZE(NavigationZoneArray); i++){
NavigationZoneArray[i] = ReadSaveBuf<CZone>(buffer); NavigationZoneArray[i] = ReadSaveBuf<CZone>(buffer);
NavigationZoneArray[i].child = GetPointerForZoneIndex((int32)NavigationZoneArray[i].child); NavigationZoneArray[i].child = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].child);
NavigationZoneArray[i].parent = GetPointerForZoneIndex((int32)NavigationZoneArray[i].parent); NavigationZoneArray[i].parent = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].parent);
NavigationZoneArray[i].next = GetPointerForZoneIndex((int32)NavigationZoneArray[i].next); NavigationZoneArray[i].next = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].next);
} }
for(i = 0; i < ARRAY_SIZE(InfoZoneArray); i++){ for(i = 0; i < ARRAY_SIZE(InfoZoneArray); i++){
InfoZoneArray[i] = ReadSaveBuf<CZone>(buffer); InfoZoneArray[i] = ReadSaveBuf<CZone>(buffer);
InfoZoneArray[i].child = GetPointerForZoneIndex((int32)InfoZoneArray[i].child); InfoZoneArray[i].child = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].child);
InfoZoneArray[i].parent = GetPointerForZoneIndex((int32)InfoZoneArray[i].parent); InfoZoneArray[i].parent = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].parent);
InfoZoneArray[i].next = GetPointerForZoneIndex((int32)InfoZoneArray[i].next); InfoZoneArray[i].next = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].next);
} }
for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++) for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++)

View file

@ -257,7 +257,7 @@ CCopPed::ArrestPlayer(void)
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ARREST_GUN, 4.0f); CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_ARREST_GUN, 4.0f);
CVector suspMidPos; 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, m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(suspMidPos.x, suspMidPos.y,
GetPosition().x, GetPosition().y); GetPosition().x, GetPosition().y);

View file

@ -231,8 +231,8 @@ CEmergencyPed::MedicAI(void)
if (nearestAccident) { if (nearestAccident) {
m_pRevivedPed = nearestAccident->m_pVictim; m_pRevivedPed = nearestAccident->m_pVictim;
m_pRevivedPed->RegisterReference((CEntity**)&m_pRevivedPed); m_pRevivedPed->RegisterReference((CEntity**)&m_pRevivedPed);
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
SetSeek((headPos + midPos) * 0.5f, 1.0f); SetSeek((headPos + midPos) * 0.5f, 1.0f);
SetObjective(OBJECTIVE_NONE); SetObjective(OBJECTIVE_NONE);
bIsRunning = true; bIsRunning = true;
@ -271,8 +271,8 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_STOP; m_nEmergencyPedState = EMERGENCY_PED_STOP;
break; break;
} }
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
SetSeek((headPos + midPos) * 0.5f, nearestAccident->m_nMedicsPerformingCPR * 0.5f + 1.0f); SetSeek((headPos + midPos) * 0.5f, nearestAccident->m_nMedicsPerformingCPR * 0.5f + 1.0f);
SetObjective(OBJECTIVE_NONE); SetObjective(OBJECTIVE_NONE);
bIsRunning = true; bIsRunning = true;
@ -326,8 +326,8 @@ CEmergencyPed::MedicAI(void)
if (!m_pRevivedPed || m_pRevivedPed->m_fHealth > 0.0f) if (!m_pRevivedPed || m_pRevivedPed->m_fHealth > 0.0f)
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE; m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
else { else {
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
midPos = (headPos + midPos) * 0.5f; midPos = (headPos + midPos) * 0.5f;
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
midPos.x, midPos.y, midPos.x, midPos.y,
@ -348,8 +348,8 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE; m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE;
break; break;
} }
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)midPos, PED_MID); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID);
m_pRevivedPed->m_pedIK.GetComponentPosition((RwV3d)headPos, PED_HEAD); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD);
midPos = (headPos + midPos) * 0.5f; midPos = (headPos + midPos) * 0.5f;
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
midPos.x, midPos.y, midPos.x, midPos.y,

View file

@ -9713,7 +9713,7 @@ CPed::MoveHeadToLook(void)
} }
if (m_pLookTarget->IsPed()) { 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 { } else {
lookPos = m_pLookTarget->GetPosition(); lookPos = m_pLookTarget->GetPosition();
} }
@ -12804,7 +12804,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
} }
// --MIAMI: Done, but enumarate weapon slots // --MIAMI: Done, but enumarate weapon slots
inline void void
CPed::ReplaceWeaponWhenExitingVehicle(void) CPed::ReplaceWeaponWhenExitingVehicle(void)
{ {
eWeaponType weaponType = GetWeapon()->m_eWeaponType; eWeaponType weaponType = GetWeapon()->m_eWeaponType;
@ -12821,7 +12821,7 @@ CPed::ReplaceWeaponWhenExitingVehicle(void)
} }
// --MIAMI: Done // --MIAMI: Done
inline void void
CPed::RemoveWeaponWhenEnteringVehicle(void) CPed::RemoveWeaponWhenEnteringVehicle(void)
{ {
if (IsPlayer() && HasWeaponSlot(5) && GetWeapon(5).m_nAmmoTotal > 0 && ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed()->m_bDriveByAllowed) { if (IsPlayer() && HasWeaponSlot(5) && GetWeapon(5).m_nAmmoTotal > 0 && ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed()->m_bDriveByAllowed) {
@ -13675,7 +13675,7 @@ CPed::ProcessObjective(void)
CVector target; CVector target;
CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f); CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f);
if (m_pedInObjective->IsPed()) if (m_pedInObjective->IsPed())
m_pedInObjective->m_pedIK.GetComponentPosition((RwV3d)target, PED_MID); m_pedInObjective->m_pedIK.GetComponentPosition(*(RwV3d *)&target, PED_MID);
else else
target = m_pedInObjective->GetPosition(); target = m_pedInObjective->GetPosition();

View file

@ -108,7 +108,7 @@ const C2dEffect* CPedAttractorManager::GetEffectForIceCreamVan(CVehicle* pVehicl
CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect) CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect)
{ {
if (vVehicleToEffect.empty()) if (vVehicleToEffect.empty())
return false; return nil;
for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) { for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) {
if (assoc->HasThisEffect(pEffect)) if (assoc->HasThisEffect(pEffect))
return assoc->GetVehicle(); return assoc->GetVehicle();
@ -625,7 +625,7 @@ CPedAttractor* CPedAttractorManager::RegisterPed(CPed* pPed, C2dEffect* pEffect,
ComputeEffectPos(pAttractor->GetEffect(), matrix, vEffectPos); ComputeEffectPos(pAttractor->GetEffect(), matrix, vEffectPos);
if (pAttractor->GetEffect() == pEffect && vEffectPos == pAttractor->GetEffectPos()) { if (pAttractor->GetEffect() == pEffect && vEffectPos == pAttractor->GetEffectPos()) {
if (!IsApproachable(pEffect, matrix, pAttractor->ComputeFreeSlot(), pPed)) if (!IsApproachable(pEffect, matrix, pAttractor->ComputeFreeSlot(), pPed))
return false; return nil;
pRegisteredAttractor = pAttractor; pRegisteredAttractor = pAttractor;
break; break;
} }

View file

@ -1252,7 +1252,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
#else #else
CVector markPos; CVector markPos;
if (m_pPointGunAt->IsPed()) { 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 { } else {
markPos = m_pPointGunAt->GetPosition(); markPos = m_pPointGunAt->GetPosition();
} }

View file

@ -175,7 +175,7 @@ CTimeCycle::Initialise(void)
bi++; bi++;
bi++; bi++;
} }
while(work_buff[bi] != '\n') while(work_buff[bi] != '\n' || work_buff[bi] != '\0')
line[li++] = work_buff[bi++]; line[li++] = work_buff[bi++];
line[li] = '\0'; line[li] = '\0';
bi++; bi++;

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "Game.h"
#include "PCSave.h" #include "PCSave.h"
#define SLOT_COUNT (8) #define SLOT_COUNT (8)

View file

@ -817,7 +817,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
CPed *threatAttack = (CPed*)shooterPed->m_pPointGunAt; CPed *threatAttack = (CPed*)shooterPed->m_pPointGunAt;
if ( threatAttack->IsPed() ) if ( threatAttack->IsPed() )
{ {
threatAttack->m_pedIK.GetComponentPosition((RwV3d)target, PED_MID); threatAttack->m_pedIK.GetComponentPosition(*(RwV3d *)&target, PED_MID);
threatAttack->ReactToPointGun(shooter); threatAttack->ReactToPointGun(shooter);
} }
else else
@ -1483,7 +1483,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
{ {
CVector pos; CVector pos;
if (shooterPed->m_pPointGunAt->IsPed()) { 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 { } else {
pos = ((CPed*)shooterPed->m_pPointGunAt)->GetPosition(); pos = ((CPed*)shooterPed->m_pPointGunAt)->GetPosition();
} }

View file

@ -59,7 +59,8 @@ static char ms_aWeaponNames[][32] = {
}; };
CWeaponInfo* CWeaponInfo*
CWeaponInfo::GetWeaponInfo(eWeaponType weaponType) { CWeaponInfo::GetWeaponInfo(eWeaponType weaponType)
{
return &CWeaponInfo::ms_apWeaponInfos[weaponType]; return &CWeaponInfo::ms_apWeaponInfos[weaponType];
} }

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "AnimManager.h"
#include "AnimationId.h" #include "AnimationId.h"
#include "WeaponType.h" #include "WeaponType.h"