28 short oldz,
bool* result_out,
short* newz_out )
30 short lowest_blocking_z = 128;
31 short highest_blocking_z = -127;
42 bool sea_ok = ( movemode &
MOVEMODE_SEA ) ?
true :
false;
44 if ( statics.empty() )
56 statics.push_back(
StaticRec( 0, static_cast<signed char>( mapz - 1 ), mapflags, 1 ) );
61 for ( StaticList::iterator itr = statics.begin(); itr != statics.end(); ++itr )
64 unsigned int flags = srec.
flags;
66 #if ENABLE_POLTEST_OUTPUT 69 INFO_PRINT <<
"static: graphic=0x" << fmt::hexu( srec.
graphic ) <<
", z=" << int( srec.
z )
70 <<
", ht=" << int( srec.
height ) <<
"\n";
76 if ( srec.
z < lowest_blocking_z )
77 lowest_blocking_z = srec.
z;
78 if ( ztemp > highest_blocking_z )
79 highest_blocking_z = ztemp;
83 if ( ( ztemp <= oldz + 7 ||
84 ( ztemp <= oldz + 10 &&
88 ( newz == -127 || srec.
graphic != 0 || ztemp > newz + 18 ) )
91 #if ENABLE_POLTEST_OUTPUT 93 INFO_PRINT <<
"Setting Z to " << int( ztemp ) <<
"\n";
103 for ( StaticList::iterator itr = statics.begin(); itr != statics.end(); ++itr )
109 if ( srec.
z <= newz + 10 &&
114 #if ENABLE_POLTEST_OUTPUT 117 INFO_PRINT <<
"static: objtype=0x" << fmt::hexu( srec.
graphic ) <<
", z=" << int( srec.
z )
118 <<
", ht=" << int( srec.
height ) <<
" blocks movement to z=" << int( newz )
128 *result_out = result;
std::vector< StaticRec > StaticList
void getmapinfo(unsigned short x, unsigned short y, short *z, USTRUCT_MAPINFO *mi)
unsigned int landtile_uoflags(unsigned short landtile)
void standheight(MOVEMODE movemode, StaticList &statics, unsigned short x, unsigned short y, short oldz, bool *result_out, short *newz_out)
bool flags_swimmable(unsigned int flags)
bool flags_standable(unsigned int flags)