<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class sfxEnemy : MonoBehaviour {

    // Use this for initialization
    private EnemyAI ea;
    //private GhostAI ga;
    public AudioSource loafer_motion;
    public AudioSource frog_attack;
	void Start () {
        ea = GetComponent<EnemyAI>();
	}
	
	// Update is called once per frame
	void Update () {
        if (ea.gameObject.GetComponent<Renderer>().isVisible)
        {
            if (ea.isRanged == false && ea.ghostOverride == false)  //If enemy is a loafer
            {
                if (ea.groundCheck == true && loafer_motion.isPlaying == false)
                {
                    loafer_motion.Play();
                }
            }
            else if (ea.isRanged == true) //If enemy is a froggy
            {
                if(Time.time > ea.nextProjectileFire && frog_attack.isPlaying ==false)
                {
                    frog_attack.Play();
                }
            }
            else if (ea.ghostOverride == true) //If ghost
            {
                //ga = GetComponent<GhostAI>();
                
            }
        }
	}
}<commit_msg>Modified enemy sfx script to check if field is null<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class sfxEnemy : MonoBehaviour {

    // Use this for initialization
    private EnemyAI ea;
    //private GhostAI ga;
    public AudioSource loafer_motion;
    public AudioSource frog_attack;
	void Start () {
        ea = GetComponent<EnemyAI>();
	}
	
	// Update is called once per frame
	void Update () {
        if (ea.gameObject.GetComponent<Renderer>().isVisible)
        {
            if (ea.isRanged == false && ea.ghostOverride == false)  //If enemy is a loafer
            {
                if (ea.groundCheck == true && loafer_motion.isPlaying == false && loafer_motion != null)
                {
                    loafer_motion.Play();
                }
            }
            else if (ea.isRanged == true) //If enemy is a froggy
            {
                if(Time.time > ea.nextProjectileFire && frog_attack.isPlaying ==false && frog_attack != null)
                {
                    frog_attack.Play();
                }
            }
            else if (ea.ghostOverride == true) //If ghost
            {
                //ga = GetComponent<GhostAI>();
                
            }
        }
	}
}
{'fraction_non_alphanumeric': 0.10040485829959514, 'fraction_numerical': 0.0, 'mean_word_length': 1.5162932790224033, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5808945', 'n_tokens_mistral': 724, 'n_tokens_neox': 673, 'n_words': 169}