public static void TryAttachFire(this Thing t, float fireSize) { if (t.CanEverAttachFire() && !t.HasAttachment(ThingDefOf.Fire)) { Fire fire = (Fire)ThingMaker.MakeThing(ThingDefOf.Fire, null); fire.fireSize = fireSize; fire.AttachTo(t); GenSpawn.Spawn(fire, t.Position, t.Map, Rot4.North, false); Pawn pawn = t as Pawn; if (pawn != null) { pawn.jobs.EndCurrentJob(JobCondition.InterruptForced, true); pawn.records.Increment(RecordDefOf.TimesOnFire); } } }
public static void TryAttachFire(this Thing t, float fireSize) { if (t.CanEverAttachFire() && !t.HasAttachment(ThingDefOf.Fire)) { Fire fire = (Fire)ThingMaker.MakeThing(ThingDefOf.Fire); fire.fireSize = fireSize; fire.AttachTo(t); GenSpawn.Spawn(fire, t.Position, t.Map, Rot4.North); Pawn pawn = t as Pawn; if (pawn != null) { pawn.jobs.StopAll(); pawn.records.Increment(RecordDefOf.TimesOnFire); } } }