Problem with enemy spawn manager

So, let me introduce you to the situation first. I have a basic scene set up, with an enemy spawn manager:

alt text

This GameObject is responsible for spawning waves of enemies into my scene. The Enemy Prefabs are the types of enemies that can be chosen to construct a wave. I have no problem with how that works yet. The bottom part where it says Starship1 and Starship2 corresponds to two other Game Objects that I have in the scene:

alt text

These just rotate around the Planet using the waypoints there, and shoot bullets. This part is fine as well. But, here is the Update() function from Spawn Management script:

void Update()
    {
        if (finished_maneuvering)
        {
            if (game_timer > game_timer_this_diff)
            {
                DifficultyUp();
            }
            game_timer += Time.deltaTime;
            if (enemy_this_wave == 0)
            {
                bool r = Random.Range(0, 100) < 70;
                if (false)
                {
                    SpawnNextWave();
                }
                else
                {
                     finished_maneuvering = false;
                    CallStarShip();
                }
            }
        }
    }

Ignore the game timer and difficulty stuff. For testing purposes of the starships, I have made it so that, anytime this script attempts to spawn a wave, it’s a starship call. Which does this:

void CallStarShip()
    {
        bool r = Random.Range(0, 100) > 50;
        if (r)
        {
            Starship1.GetComponent<StarShipScript>().InitializeStarship();
        }
        else
        {
            Starship2.GetComponent<StarShipScript>().InitializeStarship();
        }
    }

This is supposed to choose either one of the starships, and call the method InitializeStarship() from its script (which I’ve surely attached to both).
This is what InitializeStarship() looks like:

public void InitializeStarship()
    {
        faded_in = false;
        moved = false;
        faded_out = false;
        shoot = true;
        waitbeforefire /= Mathf.Clamp(SpawnManagement.difficulty_level, 1, 2.3f);
    }

Don’t worry about difficulty level, it’s not the source of error, that is a static variable. These values just play the role of telling the starship to start moving between waypoints, which may not be the most efficient way of doing it, but that’s how I could do it. Anyway, after the Starship has finished it’s route, it is supposed to go back to a place I called waypoint_4 and in the code it looks like this:

. . code in here . .
else
        {
            transform.position = Vector3.Lerp(transform.position, waypoint_4.position, fade_speed * Time.deltaTime);
            if (spawner != null)
            {
                spawner.finished_maneuvering = true;
            }
        }

I’m pretty sure that spawner isn’t null anyway, because it was set in the Start() function like this:

void Start()
    {
        spawner = GameObject.FindWithTag("enemyspawner").GetComponent<SpawnManagement>();
        transform.position = waypoint_4.position;
    }

Alright now let’s get to what the problem is:
When I start the game, I expect the SpawnManager to initialize either the Top starship, or the Bottom one. However both of them get initialized at once, and even more than once (I checked by adding Debug.Log() statements before the function call CallStarship() to test it). And, after the starships go away, new starship call should be made according to my code, but nothing is done. Why could this be happening? This is my first ever serious project, so excuse me if this is something simple, but I searched online, looked at places, and just couldn’t find a solution to this. Any help would be appreciated.

Just played around with some of my code and tested stuff using the Debug window, and found out that the statement

if (enemy_this_wave == 0)

was causing the problem. When my planet took damage, it automatically extracted 1 from this value, so it went to a negative value. I should have checked the source of the damage before directly reducing the number of enemies in the scene. So the problem doesn’t stem from anything I have mentioned above. But just in case, I reduced the number of the starships to 1, now there is only one starship, which has made it easier to maintain.