Fix Gun Dropper bug

This commit is contained in:
Sofia 2019-08-22 20:26:55 +03:00
parent 45b6cf5d9f
commit bac1c0227d
1 changed files with 4 additions and 2 deletions

View File

@ -41,6 +41,9 @@ namespace Saltosion.OneWeapon.Environment {
}
public void ExpelGun() {
if (GunsLeft <= 0) {
return;
}
GameObject Gun = PossibleGuns[Util.RandomValueBetween(0, PossibleGuns.Count - 1)];
GameObject ShotGun = GameObject.Instantiate(Gun, HoleTransform.position, new Quaternion());
Rigidbody2D Body = ShotGun.GetComponent<Rigidbody2D>();
@ -58,9 +61,8 @@ namespace Saltosion.OneWeapon.Environment {
if (GunsLeft == 0) {
if (ExplodeOnEmpty) {
Explodable.Explode(true);
} else {
Destroy(this);
}
Destroy(this);
}
}
}