From 5dc410a999f02f1e90c991c9de617bb2b1dc6bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Wed, 3 Jun 2020 16:16:31 +0300 Subject: Peds, eSound and PedState enum, fixes --- src/peds/Population.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/peds/Population.cpp') diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 40ceb6c3..ca530494 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -22,6 +22,7 @@ #include "DummyObject.h" #include "Script.h" #include "Shadows.h" +#include "SurfaceTable.h" #define MIN_CREATION_DIST 40.0f // not for start of the game (look at the GeneratePedsAtStartOfGame) #define CREATION_RANGE 10.0f // added over the MIN_CREATION_DIST. @@ -1101,3 +1102,15 @@ CPopulation::AddDeadPedInFrontOfCar(const CVector& pos, CVehicle* pCulprit) CVisibilityPlugins::SetClumpAlpha(pPed->GetClump(), 0); return pPed; } + +bool +CPopulation::IsSkateable(CVector const& pos) +{ + CColPoint foundCol; + CEntity* foundEnt = nil; + CWorld::ProcessVerticalLine(pos + CVector(0.f, 0.f, 2.f), pos.z - 2.0f, foundCol, foundEnt, true, false, false, false, false, false, nil); + if (!foundEnt) + return false; + + return foundCol.surfaceB == SURFACE_TARMAC || foundCol.surfaceB == SURFACE_PAVEMENT; +} \ No newline at end of file -- cgit v1.2.3