A thinning method using weight limitation for air-shower simulations