Quote:
Originally Posted by EFFx
Tested a little, and got these feedbacks:
A check for de_mon map:
PHP Code:
if((fOrigin[2] <= -1000.0) || (fOrigin[2] >= 350.0))
Because it generates points under the map, if you guys didn't know, the de_mon map has another simple map under the original one. So with the <= -1000.0 it doesn't spawn entities there.
About the >= 350.0, it's generating points in the montains, which is bad, because players can drop there and camp forever.
|
We're already aware of the outside areas and the hill sides. I made a stock that can be used in maps where the outside area is underground (such as de_mon). As for the 'mountains' I still don't have a solution.
PHP Code:
public Float:GetValidPoint( )
{
new Float:fPoint[ 3 ];
fPoint[ 2 ] = GetLowestPoint( );
fPoint[ 2 ] += 10.0;
while( ( engfunc( EngFunc_PointContents, fPoint ) == CONTENTS_SOLID ) || ( engfunc( EngFunc_PointContents, fPoint ) == CONTENTS_WATER ) )
{
fPoint[ 2 ] += 1.0;
}
new pcCurrent = engfunc( EngFunc_PointContents , fPoint );
if( pcCurrent == CONTENTS_EMPTY )
return fPoint[ 2 ];
return 0.0;
}
public Float:GetLowestPoint( )
{
new pcCurrent;
new Float:fStartingOffset[ 3 ];
while( ( engfunc( EngFunc_PointContents, fStartingOffset ) == CONTENTS_SOLID ) || ( engfunc( EngFunc_PointContents, fStartingOffset ) == CONTENTS_WATER ) || ( engfunc( EngFunc_PointContents, fStartingOffset ) == CONTENTS_EMPTY ) )
{
fStartingOffset[ 2 ] -= 5.0;
}
pcCurrent = engfunc( EngFunc_PointContents , fStartingOffset );
if( pcCurrent == CONTENTS_SKY )
return fStartingOffset[ 2 ];
return 0.0;
}
Usage
PHP Code:
new Float:fLowestPoint = GetValidPoint( );
FYI, -350.0 is a non stuck-free origin in de_mon. ~ -420.0 is the minimum.
__________________