Merge branch 'master' into miami

# Conflicts:
#	src/modelinfo/ClumpModelInfo.cpp
This commit is contained in:
Sergeanur
2020-05-14 17:05:42 +03:00
18 changed files with 211 additions and 153 deletions

View File

@ -498,8 +498,6 @@ CCarCtrl::GenerateOneRandomCar()
directionCurrentLinkY = pCurrentLink->GetDirY() * pVehicle->AutoPilot.m_nCurrentDirection;
directionNextLinkX = pNextLink->GetDirX() * pVehicle->AutoPilot.m_nNextDirection;
directionNextLinkY = pNextLink->GetDirY() * pVehicle->AutoPilot.m_nNextDirection;
pCurNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nCurrentRouteNode];
pNextNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
}
#else
float currentPathLinkForwardX = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirX();

View File

@ -5661,8 +5661,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
{
CollectParameters(&m_nIp, 1);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
UpdateCompareFlag(pVehicle->bIsInWater);
UpdateCompareFlag(pVehicle && pVehicle->bIsInWater);
return 0;
}
case COMMAND_GET_CLOSEST_CHAR_NODE:

View File

@ -137,7 +137,7 @@ void
CTrafficLights::ScanForLightsOnMap(void)
{
int x, y;
int i, j, l;
int i, j, k, l;
CPtrNode *node;
for(x = 0; x < NUMSECTORS_X; x++)
@ -188,8 +188,9 @@ CTrafficLights::ScanForLightsOnMap(void)
for(l = 0; l < ThePaths.m_pathNodes[i].numLinks; l++){
j = ThePaths.m_pathNodes[i].firstLink + l;
if(ThePaths.ConnectionCrossesRoad(j)){
dist2 = Abs(ThePaths.m_pathNodes[j].GetX() - light->GetPosition().x) +
Abs(ThePaths.m_pathNodes[j].GetY() - light->GetPosition().y);
k = ThePaths.ConnectedNode(j);
dist2 = Abs(ThePaths.m_pathNodes[k].GetX() - light->GetPosition().x) +
Abs(ThePaths.m_pathNodes[k].GetY() - light->GetPosition().y);
if(dist1 < 15.0f || dist2 < 15.0f)
ThePaths.ConnectionSetTrafficLight(j);
}