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 "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;
}

View File

@ -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++){

View File

@ -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++)

View File

@ -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);

View File

@ -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,

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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++;

View File

@ -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";
const char TopLineEmptyFile[] = "THIS FILE IS NOT VALID YET";

View File

@ -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);
}
}
}

View File

@ -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();
}

View File

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

View File

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