if !instance_exists(oCamera)
	exit;

var _curr_side = sign(global.player.y - y);
if flip
	_curr_side = -_curr_side;

if _curr_side != 0 && _curr_side != _prev_side
{
    if _curr_side == 1
    {
        _saved_bt = oCamera.bound_top;
        _saved_bb = oCamera.bound_bottom;
        
        if bt != -1 oCamera.bound_top    = bt;
        if bb != -1 oCamera.bound_bottom = bb;
    }
    else
    {
        if _saved_bt != -1 oCamera.bound_top    = _saved_bt;
        if _saved_bb != -1 oCamera.bound_bottom = _saved_bb;
    }
    _prev_side = _curr_side;
}