Var change between 2 RPC calls / Coroutine problem

Hello everyone !

I encountered a network problem :
I have 2 RPC calls following each other, with a yield between them. One of their attributes is a public boolean variable contained in the same script. In some cases, this boolean changes while the yield is happening. My problem is that the second RPC call does not take in account this change …

Here is the code to be more clear :

var minigunFireAborted:boolean = false;

function Update() {
    if (Input.GetButton("Fire1") && (currentWeapon == Weapon.Minigun || currentWeapon==Weapon.LanceFlammes) )
    {
    	RafaleFire();
    }
	if (Input.GetButtonUp("Fire1"))
	{
		minigunFireAborted = true;
		networkView.RPC("NetworkAnimateMinigun", RPCMode.All, 3, minigunFireAborted);
		networkView.RPC("NetworkAnimateMinigun", RPCMode.All, 4, minigunFireAborted);
	}
}

function RafaleFire()
{
	networkView.RPC("NetworkAnimateMinigun", RPCMode.All, 1, minigunFireAborted);
	yield WaitForSeconds(1.0f);
	networkView.RPC("NetworkAnimateMinigun", RPCMode.All, 2, minigunFireAborted);
}

@RPC
function NetworkAnimateMinigun (anim:int, aborted:boolean) {
	var audios:Component[]= instanceMinigun.GetComponentsInChildren(AudioSource);
	switch (anim) {
		case animationMinigun.MinigunIdle:
			instanceMinigun.animation.PlayQueued("idle");
			break;
		case animationMinigun.MinigunStart:
			instanceMinigun.animation.Play("start");
			MakeNoiseFromMinigun("rotation_minigun_start", audios, true);
			break;
		case animationMinigun.MinigunShoot:
			instanceMinigun.animation.PlayQueued("shoot");
			if (!aborted)
			{ // HERE IS THE PROBLEM, ABORTED IS ALWAYS FALSE EVEN IF THE PLAYER RELEASED FIRE1
				MakeNoiseFromMinigun("rotation_minigun_shoot", audios, true);
				MakeNoiseFromMinigun("shoot_minigun", audios, true);
			}
			break;
		case animationMinigun.MinigunStop:
			instanceMinigun.animation.Play("stop");
			MakeNoiseFromMinigun("rotation_minigun_shoot", audios, false);
			MakeNoiseFromMinigun("rotation_minigun_stop", audios, true);
			break;
		case animationMinigun.MinigunWithoutAmmo:
			MakeNoiseFromMinigun("shoot_minigun", audios, false);
			break;
	}
}

Thanks by advance for the help !

EDIT : this appears to be a problem with the coroutine RafaleFire(). If someone has an idea … It seems that since RafaleFire() is a coroutine, then changes that appear in the 1 secon lap time in the Update() method are not taken in account. The coroutine continues with the “previous” state of variables when it was firstly launched …

Seems to me the problem is with your RPC declaration; RPCs cannot have a boolean parameter!
See here for more details.