//Overwriting Oven.StartCooking void StartCooking(BaseOven oven) { if ((Settings.UsePermissions && !permission.UserHasPermission(oven.OwnerID.ToString(), permAllow))) { oven.StartCooking(); return; } if (FindBurnable(oven) == null) { return; } oven.UpdateAttachmentTemperature(); var data = oven.transform.GetOrAddComponent<FurnaceData>(); oven.CancelInvoke(oven.Cook); oven.InvokeRepeating(data.CookOverride, 0.5f, 0.5f); oven.SetFlag(BaseEntity.Flags.On, true, false); }
public void Awake() { entity = GetComponent <BaseOven>(); lastOn = false; entity.SetFlag(BaseEntity.Flags.On, false); var expEnt = GameManager.server.CreateEntity("assets/prefabs/tools/c4/explosive.timed.deployed.prefab", entity.transform.position, new Quaternion(), true); TimedExplosive explosive = expEnt.GetComponent <TimedExplosive>(); explosive.timerAmountMax = ins.configData.Explosives.Timer; explosive.timerAmountMin = ins.configData.Explosives.Timer; explosive.explosionRadius = ins.configData.Explosives.Radius; explosive.damageTypes = new List <Rust.DamageTypeEntry> { new Rust.DamageTypeEntry { amount = ins.configData.Explosives.Amount, type = Rust.DamageType.Explosion } }; explosive.Spawn(); entity.InvokeRepeating(this.ToggleLight, 0.5f, 0.5f); }