Index: pol-core/plib/realmfunc.cpp =================================================================== --- pol-core/plib/realmfunc.cpp (revision 533) +++ pol-core/plib/realmfunc.cpp (working copy) @@ -63,6 +63,7 @@ bool land_ok = (movemode & MOVEMODE_LAND) ? true : false; bool sea_ok = (movemode & MOVEMODE_SEA) ? true : false; bool fly_ok = (movemode & MOVEMODE_FLY) ? true : false; + bool in_overflight = false; short the_boost = 0; short new_boost = 0; @@ -90,23 +91,30 @@ if ( (land_ok && (flags&FLAG::MOVELAND)) || (sea_ok && (flags&FLAG::MOVESEA)) || - (fly_ok && (flags&FLAG::OVERFLIGHT)) ) + (fly_ok && (flags&FLAG::OVERFLIGHT)) || + (fly_ok && ((flags&FLAG::GRADUAL) && (flags&FLAG::MORE_SOLIDS))) || + (fly_ok && (shape.height >= 100 && in_overflight && ((flags&FLAG::BLOCKSIGHT) && (flags&FLAG::BLOCKING))))) { if ( ((ztop <= oldz+2+the_boost) || ((flags&FLAG::GRADUAL)&&(ztop <= oldz+15)) // not too high to step onto - || (fly_ok && (flags&FLAG::OVERFLIGHT) && (ztop <= oldz+20))) && // seems that flying allows higher steps + || (fly_ok && (flags&FLAG::OVERFLIGHT || ((flags&FLAG::GRADUAL) && (flags&FLAG::MORE_SOLIDS)) || ((flags&FLAG::BLOCKSIGHT) && (flags&FLAG::BLOCKING))) && (ztop <= oldz+20 || shape.height >= 100))) && // seems that flying allows higher steps (ztop >= newz) ) // but above or same as the highest yet seen { #if ENABLE_POLTEST_OUTPUT if (static_debug_on) cout << "Setting Z to " << int(ztemp) << endl; #endif possible_shapes.push_back( &shape); - newz = ztop; + if (ztop > 127) + newz = 127; + else + newz = ztop; + if (fly_ok && (flags&FLAG::OVERFLIGHT || ((flags&FLAG::GRADUAL) && (flags&FLAG::MORE_SOLIDS)) )) + in_overflight = true; } } if ( newz < shape.z && shape.z < newz+PLAYER_CHARACTER_HEIGHT) // space too small to stand? { - if (!possible_shapes.empty()) + if (!possible_shapes.empty()) possible_shapes.pop_back(); // remove the last pos_shape } } @@ -121,6 +129,8 @@ bool result = true; const MapShape* pos_shape = (*pos_itr); newz = pos_shape->z + pos_shape->height; + if (newz > 127) + newz = oldz; for( MapShapeList::const_iterator itr = shapes.begin(), itrend= shapes.end(); itr != itrend; ++itr ) { const MapShape& shape = (*itr); @@ -145,9 +155,18 @@ << " blocks movement to z=" << int(newz) << endl; } #endif - - result = false; - break; + if (fly_ok && in_overflight && newz < shape_top && shape.z <= newz) + { + if (shape.height >= 100 || shape_top > 127) + newz = oldz; + else + newz = shape_top; + } + else + { + result = false; + break; + } } }