if !instance_exists(oCamera)
	exit;

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

if _curr_side != 0 && _curr_side != _prev_side
{
    if _curr_side == 1
    {
        _saved_bl = oCamera.bound_left;
        _saved_br = oCamera.bound_right;
        
        if bl != -1 oCamera.bound_left   = bl;
        if br != -1 oCamera.bound_right  = br;
    }
    else
    {
        if _saved_bl != -1 oCamera.bound_left   = _saved_bl;
        if _saved_br != -1 oCamera.bound_right  = _saved_br;
    }
    _prev_side = _curr_side;
}