[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
Building_Door.<GetGizmos>c__Iterator13C <GetGizmos>c__Iterator13C = new Building_Door.<GetGizmos>c__Iterator13C();
<GetGizmos>c__Iterator13C.<>f__this = this;
Building_Door.<GetGizmos>c__Iterator13C expr_0E = <GetGizmos>c__Iterator13C;
expr_0E.$PC = -2;
return expr_0E;
}
what is it
what does it do
why does it break every compiler
how do i make it stop
go get this:
https://github.com/Zhentar/ILSpy/releases/tag/v1.0.1
then decompile it again. Then thank zhentar.
this is result of "yield return" syntax sugar compilation
now the old thing is gone but it has issues with the new one
[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
foreach (Gizmo g in base.GetGizmos())
{
yield return g;
}
if (base.Faction == Faction.OfPlayer)
{
yield return new Command_Toggle
{
defaultLabel = "CommandToggleDoorHoldOpen".Translate(),
defaultDesc = "CommandToggleDoorHoldOpenDesc".Translate(),
hotKey = KeyBindingDefOf.Misc3,
icon = TexCommand.HoldOpen,
isActive = (() => this.<>f__this.holdOpenInt),
toggleAction = delegate
{
this.<>f__this.holdOpenInt = !this.<>f__this.holdOpenInt;
this.<>f__this.Map.reachability.ClearCache();
if (this.<>f__this.Open && this.<>f__this.holdOpenInt)
{
this.<>f__this.freePassageUntilClosed = true;
}
}
};
}
}
ok I actually figured it out by just going to the source code for the door and now my totally original door works but it has no animations and i totally dont know why
you should try dnspy with compilergenerated code displayed, to make sure, that entire code is present and nothing is missed.
Kk ill try that after my comp is done getting deep fried by tropical storm thx guys
Im just trying to make an exact copy of the base door class with a different class name so that i can use the copied class for different doors that are affected by dooropenspeed differently since its hardcoded how much an autodoor is faster than a normal door
Just so you know core has hard coded references to the core door class you will have to detour every pathfinding method etc that mentions the core one to also check for your one. This is why modders dont mod doors...