Skip to content

EA 23.57 Nightly

December 15, 2024

10 files modified.

Important Changes

None.

AI_Idle

@@ -155,20 +155,20 @@ public override IEnumerable<Status> Run()

cs
			Thing thing2 = owner.things.Find("polish_powder");
			if (thing2 != null && EClass._map.props.installed.Find<TraitGrindstone>() != null)
			{
				foreach (Thing thing7 in owner.things) 
				foreach (Thing thing8 in owner.things) 
				{
					if (!thing7.IsEquipment || thing7.encLV >= 0) 
					if (!thing8.IsEquipment || thing8.encLV >= 0) 
					{
						continue;
					}
					for (int i = 0; i < 5; i++)
					{
						if (thing7.encLV >= 0) 
						if (thing8.encLV >= 0) 
						{
							break;
						}
						owner.Say("polish", owner, thing7); 
						thing7.ModEncLv(1); 
						owner.Say("polish", owner, thing8); 
						thing8.ModEncLv(1); 
						thing2.ModNum(-1);
						if (thing2.isDestroyed)
						{

@@ -192,6 +192,17 @@ public override IEnumerable<Status> Run()

cs
				});
				yield return Restart();
			}
			if (EClass.rnd(20) == 0) 
			{ 
				Thing thing3 = owner.things.Find((Thing a) => a.parent == owner && a.isGifted && (a.category.id == "skillbook" || a.category.id == "ancientbook")); 
				if (thing3 != null && thing3.trait.CanRead(owner)) 
				{ 
					yield return Do(new AI_Read
					{ 
						target = thing3 
					}); 
				} 
			} 
			if (EClass.rnd(100) == 0 && !EClass._zone.IsRegion && owner.HasElement(1227))
			{
				List<Chara> list2 = new List<Chara>();

@@ -388,7 +399,7 @@ public override IEnumerable<Status> Run()

cs
		}
		else if (EClass.player.stats.turns > owner.turnLastSeen + 50 && Los.IsVisible(EClass.pc, owner) && owner.CanSee(EClass.pc))
		{
			if (EClass.rnd(5) == 0 && owner.hostility >= Hostility.Neutral && EClass.pc.IsPCC && EClass.pc.pccData.state == PCCState.Undie) 
			if (EClass.rnd(5) == 0 && owner.hostility >= Hostility.Neutral && EClass.pc.IsPCC && EClass.pc.pccData.state == PCCState.Undie && EClass.pc.pos.cell.IsTopWaterAndNoSnow) 
			{
				owner.Talk("pervert3");
			}

@@ -426,9 +437,9 @@ public override IEnumerable<Status> Run()

cs
		{
			if (owner.noMove)
			{
				foreach (Thing thing8 in owner.pos.Things) 
				foreach (Thing thing9 in owner.pos.Things) 
				{
					if (thing8.IsInstalled && thing8.trait is TraitGeneratorWheel) 
					if (thing9.IsInstalled && thing9.trait is TraitGeneratorWheel) 
					{
						owner.Talk("labor");
						owner.PlayAnime(AnimeID.Shiver);

@@ -478,19 +489,19 @@ public override IEnumerable<Status> Run()

cs
	}
	if (EClass.rnd(2000) == 0 && owner.IsHuman && (owner.host == null || owner.host.ride != owner))
	{
		Thing thing3 = owner.things.Find((Thing a) => !a.IsNegativeGift && a.trait.CanDrink(owner), recursive: false); 
		if (thing3 != null && thing3.trait is TraitPotion && owner.IsPCParty) 
		Thing thing4 = owner.things.Find((Thing a) => !a.IsNegativeGift && a.trait.CanDrink(owner), recursive: false); 
		if (thing4 != null && thing4.trait is TraitPotion && owner.IsPCParty) 
		{
			thing3 = null; 
			thing4 = null; 
		}
		if (thing3 == null && (owner.homeBranch == null || !owner.homeBranch.policies.IsActive(2503))) 
		if (thing4 == null && (owner.homeBranch == null || !owner.homeBranch.policies.IsActive(2503))) 
		{
			thing3 = ThingGen.Create("crimAle"); 
			owner.Drink(thing3); 
			thing4 = ThingGen.Create("crimAle"); 
			owner.Drink(thing4); 
		}
		if (thing3 != null && !thing3.isDestroyed) 
		if (thing4 != null && !thing4.isDestroyed) 
		{
			owner.TryUse(thing3); 
			owner.TryUse(thing4); 
			yield return Restart();
		}
	}

@@ -610,8 +621,8 @@ public override IEnumerable<Status> Run()

cs
	}
	if (EClass.rnd(EClass.debug.enable ? 3 : 30) == 0)
	{
		Thing thing4 = owner.things.Find<TraitBall>(); 
		if (thing4 == null) 
		Thing thing5 = owner.things.Find<TraitBall>(); 
		if (thing5 == null) 
		{
			owner.pos.ForeachNeighbor(delegate(Point p)
			{

@@ -628,7 +639,7 @@ public override IEnumerable<Status> Run()

cs
			{
				if (EClass.rnd(3) != 0 && chara4 != owner && chara4.Dist(owner) <= 6 && chara4.Dist(owner) >= 3 && Los.IsVisible(chara4, owner))
				{
					ActThrow.Throw(owner, chara4.pos, thing4); 
					ActThrow.Throw(owner, chara4.pos, thing5); 
					break;
				}
			}

@@ -683,26 +694,26 @@ public override IEnumerable<Status> Run()

cs
			{
				break;
			}
			List<Thing> list3 = owner.things.List((Thing a) => a.parent == owner && (a.category.id == "spellbook" || a.category.id == "ancientbook" || a.category.id == "skillbook")); 
			Thing thing5 = null; 
			List<Thing> list3 = owner.things.List((Thing a) => a.parent == owner && (a.category.id == "spellbook" || a.category.id == "ancientbook" || a.category.id == "skillbook"), onlyAccessible: true); 
			Thing thing6 = null; 
			if (list3.Count > 0)
			{
				thing5 = list3.RandomItem(); 
				if (!thing5.trait.CanRead(owner)) 
				thing6 = list3.RandomItem(); 
				if (!thing6.trait.CanRead(owner)) 
				{
					thing5 = null; 
					thing6 = null; 
				}
			}
			if (thing5 == null) 
			if (thing6 == null) 
			{
				if (owner.things.IsFull())
				{
					break;
				}
				thing5 = ThingGen.CreateFromCategory((EClass.rnd(5) != 0) ? "spellbook" : "ancientbook"); 
				thing5.isNPCProperty = true; 
				thing6 = ThingGen.CreateFromCategory((EClass.rnd(5) != 0) ? "spellbook" : "ancientbook"); 
				thing6.isNPCProperty = true; 
			}
			if (!(thing5.id == "1084") || !owner.IsPCFaction) 
			if (!(thing6.id == "1084") || !owner.IsPCFaction) 
			{
				if (!owner.HasElement(285))
				{

@@ -710,7 +721,7 @@ public override IEnumerable<Status> Run()

cs
				}
				yield return Do(new AI_Read
				{
					target = thing5 
					target = thing6 
				});
			}
			break;

@@ -772,10 +783,10 @@ public override IEnumerable<Status> Run()

cs
	}
	if (EClass.rnd(100) == 0 && owner.id == "bee")
	{
		Thing thing6 = EClass._map.ListThing<TraitBeekeep>()?.RandomItem(); 
		if (thing6 != null) 
		Thing thing7 = EClass._map.ListThing<TraitBeekeep>()?.RandomItem(); 
		if (thing7 != null) 
		{
			yield return DoGoto(thing6.pos); 
			yield return DoGoto(thing7.pos); 
		}
	}
	string aiIdle = owner.source.aiIdle;

ActEffect

@@ -894,9 +894,9 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		TC.PlaySound("curse3");
		TC.PlayEffect("curse");
		TC.Say("forgetItems", TC);
		int num5 = power / 50 + 1 + EClass.rnd(3); 
		int num3 = power / 50 + 1 + EClass.rnd(3); 
		List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
		for (int j = 0; j < num5; j++) 
		for (int j = 0; j < num3; j++) 
		{
			source.RandomItem().c_IDTState = 5;
		}

@@ -908,10 +908,10 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
	case EffectId.EnchantArmorGreat:
	{
		bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
		bool flag2 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat; 
		bool flag3 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat; 
		if (!tc.isThing)
		{
			LayerDragGrid.CreateEnchant(CC, armor, flag2, state); 
			LayerDragGrid.CreateEnchant(CC, armor, flag3, state); 
			return;
		}
		cc.PlaySound("identify");

@@ -922,8 +922,8 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
			tc.ModEncLv(-1);
			break;
		}
		int num = (flag2 ? 4 : 2) + (blessed ? 1 : 0); 
		if (tc.encLV >= num) 
		int num4 = (flag3 ? 4 : 2) + (blessed ? 1 : 0); 
		if (tc.encLV >= num4) 
		{
			cc.Say("enc_resist", tc);
			break;

@@ -959,17 +959,17 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
			LayerDragGrid.CreateUncurse(CC, state);
			return;
		}
		Thing thing3 = tc.Thing; 
		if (thing3.blessedState == BlessedState.Cursed) 
		Thing thing2 = tc.Thing; 
		if (thing2.blessedState == BlessedState.Cursed) 
		{
			thing3.SetBlessedState(BlessedState.Normal); 
			thing2.SetBlessedState(BlessedState.Normal); 
		}
		else if (thing3.blessedState == BlessedState.Doomed) 
		else if (thing2.blessedState == BlessedState.Doomed) 
		{
			thing3.SetBlessedState(BlessedState.Normal); 
			thing2.SetBlessedState(BlessedState.Normal); 
		}
		thing3.GetRootCard()?.TryStack(thing3); 
		LayerInventory.SetDirty(thing3); 
		thing2.GetRootCard()?.TryStack(thing2); 
		LayerInventory.SetDirty(thing2); 
		break;
	}
	case EffectId.Lighten:

@@ -985,7 +985,7 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		}
		cc.PlaySound("offering");
		cc.PlayEffect("buff");
		int num4 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight); 
		int num5 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight); 
		tc.isWeightChanged = true;
		Element orCreateElement = tc.elements.GetOrCreateElement(64);
		Element orCreateElement2 = tc.elements.GetOrCreateElement(65);

@@ -994,10 +994,10 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		bool flag5 = tc.IsEquipmentOrRanged || tc.IsThrownWeapon || tc.IsAmmo;
		if (flag)
		{
			num4 = (int)(0.01f * (float)num4 * (float)power * 0.75f + 500f); 
			if (num4 < 1) 
			num5 = (int)(0.01f * (float)num5 * (float)power * 0.75f + 500f); 
			if (num5 < 1) 
			{
				num4 = 1; 
				num5 = 1; 
			}
			if (flag5)
			{

@@ -1016,7 +1016,7 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		}
		else
		{
			num4 = num4 * (100 - power / 10) / 100; 
			num5 = num5 * (100 - power / 10) / 100; 
			if (blessed)
			{
				power /= 4;

@@ -1036,7 +1036,7 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
			}
			cc.Say("lighten", cc, tc);
		}
		tc.c_weight = num4; 
		tc.c_weight = num5; 
		tc.SetDirtyWeight();
		if (tc.parent == null)
		{

@@ -1060,13 +1060,13 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		cc.PlayEffect("identify");
		cc.Say("reconstruct", cc, tc);
		EClass.game.cards.uidNext += EClass.rnd(30);
		Thing thing2 = ThingGen.Create(tc.id, -1, tc.LV * power / 100); 
		thing2.SetBlessedState(state); 
		Thing thing3 = ThingGen.Create(tc.id, -1, tc.LV * power / 100); 
		thing3.SetBlessedState(state); 
		tc.Destroy();
		CC.Pick(thing2, msg: false); 
		CC.Pick(thing3, msg: false); 
		if (!CC.IsPC)
		{
			CC.TryEquip(thing2); 
			CC.TryEquip(thing3); 
		}
		break;
	}

@@ -1087,28 +1087,28 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		string name = tc.Name;
		if (row == null)
		{
			bool num2 = id == EffectId.ChangeMaterialGreater; 
			bool flag3 = id == EffectId.ChangeMaterialLesser; 
			bool num = id == EffectId.ChangeMaterialGreater; 
			bool flag2 = id == EffectId.ChangeMaterialLesser; 
			string text2 = tc.Thing.source.tierGroup;
			Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
			int num3 = 1; 
			int num2 = 1; 
			if (flag)
			{
				num3 -= 2; 
				num2 -= 2; 
			}
			if (blessed)
			{
				num3++; 
				num2++; 
			}
			if (num2) 
			if (num) 
			{
				num3++; 
				num2++; 
			}
			if (flag3) 
			if (flag2) 
			{
				num3 -= 2; 
				num2 -= 2; 
			}
			num3 = Mathf.Clamp(num3 + EClass.rnd(2), 0, 4); 
			num2 = Mathf.Clamp(num2 + EClass.rnd(2), 0, 4); 
			if (EClass.rnd(10) == 0)
			{
				text2 = ((text2 == "metal") ? "leather" : "metal");

@@ -1116,7 +1116,7 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
			SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
			for (int i = 0; i < 1000; i++)
			{
				row = tierList.tiers[num3].Select(); 
				row = tierList.tiers[num2].Select(); 
				if (row != tc.material)
				{
					break;

@@ -1125,11 +1125,14 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		}
		cc.PlaySound("offering");
		cc.PlayEffect("buff");
		foreach (Element item2 in tc.elements.dict.Values.ToList()) 
		if (tc.id == "log" && tc.material.alias == "carbone") 
		{
			if (item2.IsTrait && item2.vBase != 0) 
			foreach (Element item2 in tc.elements.dict.Values.ToList()) 
			{
				tc.elements.ModBase(item2.id, -item2.vBase); 
				if (item2.IsTrait && item2.vBase != 0) 
				{ 
					tc.elements.ModBase(item2.id, -item2.vBase); 
				} 
			}
		}
		tc.ChangeMaterial(row);

BaseTileMap

@@ -1254,7 +1254,7 @@ public virtual void DrawTile()

cs
			fogged = true;
		}
	}
	goto IL_7a63; 
	goto IL_7a73; 
	IL_1668:
	if (this.cell.isSlopeEdge)
	{

@@ -1859,7 +1859,7 @@ public virtual void DrawTile()

cs
	}
	if (!buildMode && this.cell.highlight != 0)
	{
		if (this.cell._block != 0) 
		if (this.cell._block != 0 && !this.cell.hasDoor) 
		{
			screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
		}

@@ -2449,239 +2449,31 @@ public virtual void DrawTile()

cs
	{
		if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
		{
			goto IL_6f59; 
			goto IL_6f69; 
		}
		if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
		{
			Room obj = this.cell.FrontRight.room;
			if (obj == null || !obj.HasRoof)
			{
				goto IL_6f59; 
				goto IL_6f69; 
			}
		}
	}
	goto IL_6fb9; 
	IL_6fb9: 
	if (this.cell.effect != null) 
	{ 
		if (this.cell.effect.IsLiquid) 
		{ 
			SourceCellEffect.Row sourceEffect = this.cell.sourceEffect; 
			SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial; 
			tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4; 
			param.tile = tile + this.cell.sourceEffect._tiles[0]; 
			param.mat = defaultMaterial; 
			param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color); 
			sourceEffect.renderData.Draw(param); 
		} 
		else
		{ 
			param.tile = this.cell.effect.source._tiles[0]; 
			SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect; 
			if (sourceEffect2.anime.Length != 0) 
			{ 
				if (sourceEffect2.anime.Length > 2) 
				{ 
					float num19 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2]; 
					if (!(num19 >= (float)sourceEffect2.anime[0])) 
					{ 
						param.tile += num19; 
					} 
				} 
				else
				{ 
					float num20 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0]; 
					param.tile += num20; 
				} 
			} 
			if (this.cell.effect.IsFire) 
			{ 
				rendererEffect.Draw(param); 
			} 
			else
			{ 
				this.cell.effect.source.renderData.Draw(param); 
			} 
		} 
	} 
	param.color = floorLight; 
	if (this.cell.critter != null) 
	{ 
		Critter critter = this.cell.critter; 
		int snowTile = critter.tile; 
		if (snowed && critter.SnowTile != 0) 
		{ 
			critter.x = 0.06f; 
			critter.y = -0.06f; 
			snowTile = critter.SnowTile; 
		} 
		else
		{ 
			critter.Update(); 
		} 
		pass = passObjSS; 
		batch = pass.batches[pass.batchIdx]; 
		batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f; 
		batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f; 
		batch.matrices[pass.idx].m23 = param.z; 
		batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1)); 
		batch.colors[pass.idx] = floorLight; 
		pass.idx++; 
		if (pass.idx == pass.batchSize) 
		{ 
			pass.NextBatch(); 
		} 
	} 
	if (detail != null) 
	{ 
		TransAnime anime3 = detail.anime; 
		if (anime3 != null && !anime3.animeBlock) 
		{ 
			TransAnime anime4 = detail.anime; 
			param.x += anime4.v.x; 
			param.y += anime4.v.y; 
			param.z += anime4.v.z; 
		} 
	} 
	if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap) 
	{ 
		SourceObj.Row sourceObj = this.cell.sourceObj; 
		if (!snowed || sourceObj.snowTile <= 0) 
		{ 
			param.snow = snowed; 
			param.mat = this.cell.matObj; 
			orgY = param.y; 
			if (param.liquidLv > 0) 
			{ 
				if (sourceObj.pref.Float) 
				{ 
					param.y += 0.01f * floatY; 
					if (liquidLv > 10) 
					{ 
						liquidLv = TileType.FloorWaterShallow.LiquidLV * 10; 
					} 
					liquidLv -= (int)(floatY * 0.5f); 
					param.liquidLv = liquidLv; 
				} 
				if (sourceObj.tileType.IsWaterTop) 
				{ 
					param.liquidLv = 0; 
				} 
				else
				{ 
					param.liquidLv += sourceObj.pref.liquidMod; 
					if (param.liquidLv < 1) 
					{ 
						param.liquid = 1f; 
					} 
					else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax) 
					{ 
						param.liquidLv = 99 + sourceObj.pref.liquidModMax; 
					} 
				} 
			} 
			if (sourceObj.useAltColor) 
			{ 
				param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod)); 
			} 
			else
			{ 
				param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod)); 
			} 
			if (sourceObj.HasGrowth) 
			{ 
				this.cell.growth.OnRenderTileMap(param); 
			} 
			else
			{ 
				if (this.cell.autotileObj != 0) 
				{ 
					param.tile = sourceObj._tiles[0] + this.cell.autotileObj; 
				} 
				else if (sourceObj.tileType.IsUseBlockDir) 
				{ 
					param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length]; 
				} 
				else
				{ 
					param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length]; 
				} 
				if (_lowblock && sourceObj.tileType.IsSkipLowBlock) 
				{ 
					param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000; 
				} 
				orgY = param.y; 
				orgZ = param.z; 
				param.y += sourceObj.pref.y; 
				param.z += sourceObj.pref.z; 
				sourceObj.renderData.Draw(param); 
				param.y = orgY; 
				param.z = orgZ; 
				int shadow3 = sourceObj.pref.shadow; 
				if (shadow3 > 1 && !this.cell.ignoreObjShadow) 
				{ 
					passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow3], sourceObj.pref, 0, param.snow); 
				} 
				param.y = orgY; 
			} 
		} 
	} 
	if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood) 
	{ 
		passDecal.Add(param, (int)this.cell.decal, floorLight); 
	} 
	if (highlightCells) 
	{ 
		switch (ActionMode.FlagCell.mode) 
		{ 
		case AM_FlagCell.Mode.flagWallPillar: 
			if (this.cell.isToggleWallPillar) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		case AM_FlagCell.Mode.flagSnow: 
			if (this.cell.isClearSnow) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		case AM_FlagCell.Mode.flagFloat: 
			if (this.cell.isForceFloat) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		case AM_FlagCell.Mode.flagClear: 
			if (this.cell.isClearArea) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		} 
	} 
	if (detail == null) 
	{ 
		return; 
	} 
	if (highlightArea && detail.area != null) 
	{ 
		passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f); 
	} 
	if (detail.footmark != null && sourceFloor.id != 0) 
	goto IL_6fc9; 
	IL_6f69: 
	if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null) 
	{
		param.tile = detail.footmark.tile; 
		param.mat = matFloor; 
		param.matColor = 104025f; 
		renderFootmark.Draw(param); 
		param.tile = num12; 
		rendererFov.Draw(param); 
	}
	goto IL_7a63; 
	IL_7a63: 
	goto IL_6fc9; 
	IL_7a73: 
	if (detail.things.Count == 0 && detail.charas.Count == 0)
	{
		return;
	}
	int num21 = 0; 
	int num19 = 0; 
	thingPos.x = 0f;
	thingPos.y = 0f;
	thingPos.z = 0f;

@@ -2711,17 +2503,17 @@ public virtual void DrawTile()

cs
		param.y -= TileType.FloorWaterShallow.FloorHeight;
	}
	Thing thing = null;
	bool shadow4 = liquidLv == 0; 
	float num22 = 0f; 
	float num23 = 0f; 
	bool shadow3 = liquidLv == 0; 
	float num20 = 0f; 
	float num21 = 0f; 
	bool flag10 = false;
	float num24 = 0f; 
	float num22 = 0f; 
	bool flag11 = false;
	float num25 = 0f; 
	float num23 = 0f; 
	if (detail.things.Count > 0 && isSeen)
	{
		_ = zSetting.max1;
		float num26 = 0f; 
		float num24 = 0f; 
		for (int m = 0; m < detail.things.Count; m++)
		{
			Thing t = detail.things[m];

@@ -2736,12 +2528,12 @@ public virtual void DrawTile()

cs
			{
				pref = rendererObjDummy.shadowPref;
			}
			float num27 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height))); 
			float num25 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height))); 
			if (t.ignoreStackHeight)
			{
				thingPos.y -= num22; 
				thingPos.y -= num20; 
			}
			shadow4 = thingPos.y < 0.16f && num25 < 0.16f; 
			shadow3 = thingPos.y < 0.16f && num23 < 0.16f; 
			_ = pref.bypassShadow;
			param.shadowFix = 0f - thingPos.y;
			param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);

@@ -2751,20 +2543,20 @@ public virtual void DrawTile()

cs
				SetRoofHeight(param, this.cell, cx, cz);
				_actorPos.x = param.x;
				_actorPos.y = param.y;
				_actorPos.z = param.z + num26; 
				_actorPos.z = param.z + num24; 
				if (this.room != null)
				{
					param.color = GetRoofLight(this.room.lot);
				}
				shadow4 = false; 
				shadow3 = false; 
				param.liquidLv = 0;
			}
			else
			{
				param.snow = snowed;
				_actorPos.x = orgX + num23; 
				_actorPos.x = orgX + num21; 
				_actorPos.y = orgY;
				_actorPos.z = orgZ + num26 + thingPos.z; 
				_actorPos.z = orgZ + num24 + thingPos.z; 
				if (tileType.CanStack || !isInstalled)
				{
					if (thing?.id != t.id)

@@ -2774,7 +2566,7 @@ public virtual void DrawTile()

cs
					_actorPos.y += thingPos.y;
					if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
					{
						_actorPos.y -= num22; 
						_actorPos.y -= num20; 
					}
					_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;
				}

@@ -2791,7 +2583,7 @@ public virtual void DrawTile()

cs
						freePos.z += rampFix2.z;
						if (!this.cell.IsTopWater || t.altitude > 0)
						{
							num25 += rampFix2.y; 
							num23 += rampFix2.y; 
						}
						liquidLv -= (int)(rampFix2.y * 150f);
						if (liquidLv < 0)

@@ -2801,17 +2593,17 @@ public virtual void DrawTile()

cs
					}
					else if (!flag11 && t.trait.IsChangeFloorHeight)
					{
						orgY += num27 + (float)t.altitude * altitudeFix.y; 
						orgY += num25 + (float)t.altitude * altitudeFix.y; 
						orgZ += (float)t.altitude * altitudeFix.z;
						freePos.y += num27 + (float)t.altitude * altitudeFix.y; 
						freePos.y += num25 + (float)t.altitude * altitudeFix.y; 
						if (!this.cell.IsTopWater || t.altitude > 0)
						{
							num25 += num27 + (float)t.altitude * altitudeFix.y; 
							num23 += num25 + (float)t.altitude * altitudeFix.y; 
						}
						_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
						_actorPos.z += pref.z;
						thingPos.z += pref.z;
						liquidLv -= (int)(num27 * 150f); 
						liquidLv -= (int)(num25 * 150f); 
						if (liquidLv < 0)
						{
							liquidLv = 0;

@@ -2819,7 +2611,7 @@ public virtual void DrawTile()

cs
					}
					else
					{
						thingPos.y += num27; 
						thingPos.y += num25; 
						_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
						_actorPos.z += pref.z;
						if (pref.height >= 0f)

@@ -2834,7 +2626,7 @@ public virtual void DrawTile()

cs
				}
				else
				{
					thingPos.y += num27; 
					thingPos.y += num25; 
					_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
					_actorPos.z += pref.z;
					thingPos.z += pref.z;

@@ -2842,10 +2634,10 @@ public virtual void DrawTile()

cs
				if (t.isFloating && isWater && !hasBridge && !flag)
				{
					flag = true;
					float num28 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
					orgY += 0.01f * floatY - num28; 
					num24 = num27; 
					_actorPos.y += 0.01f * floatY - num28; 
					float num26 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
					orgY += 0.01f * floatY - num26; 
					num22 = num25; 
					_actorPos.y += 0.01f * floatY - num26; 
					if (liquidLv > 10)
					{
						liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;

@@ -2857,10 +2649,10 @@ public virtual void DrawTile()

cs
					}
					param.liquidLv = liquidLv;
				}
				num22 = num27; 
				num20 = num25; 
				if (t.sourceCard.multisize && !t.trait.IsGround)
				{
					num26 += zSetting.multiZ; 
					num24 += zSetting.multiZ; 
				}
				orgZ += t.renderer.data.stackZ;
				if (param.liquidLv > 0)

@@ -2905,7 +2697,7 @@ public virtual void DrawTile()

cs
					flag10 = true;
				}
				tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
				shadow4 = false; 
				shadow3 = false; 
				param.liquidLv = 0;
				if (t.freePos)
				{

@@ -2937,35 +2729,35 @@ public virtual void DrawTile()

cs
			{
				if (iconMode != 0)
				{
					int num29 = 0; 
					int num27 = 0; 
					switch (iconMode)
					{
					case CardIconMode.Visibility:
						if (t.isMasked)
						{
							num29 = 17; 
							num27 = 17; 
						}
						break;
					case CardIconMode.State:
						if (t.placeState == PlaceState.installed)
						{
							num29 = 18; 
							num27 = 18; 
						}
						break;
					case CardIconMode.Deconstruct:
						if (t.isDeconstructing)
						{
							num29 = 14; 
							num27 = 14; 
						}
						break;
					}
					if (t.isNPCProperty && !EMono.debug.godBuild)
					{
						num29 = 13; 
						num27 = 13; 
					}
					if (num29 != 0) 
					if (num27 != 0) 
					{
						passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num29); 
						passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num27); 
					}
				}
				t.SetRenderParam(param);

@@ -2982,17 +2774,17 @@ public virtual void DrawTile()

cs
						_actorPos.x = EMono.pc.renderer.position.x;
						_actorPos.y = EMono.pc.renderer.position.y - pref.height;
						_actorPos.z = EMono.pc.renderer.position.z + 0.02f;
						t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow4 || tileType.AlwaysShowShadow)); 
						t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow3 || tileType.AlwaysShowShadow)); 
					});
				}
				else
				{
					t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow4 || tileType.AlwaysShowShadow)); 
					t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow3 || tileType.AlwaysShowShadow)); 
				}
			}
			if (isInstalled)
			{
				num23 += pref.stackX * (float)((!t.flipX) ? 1 : (-1)); 
				num21 += pref.stackX * (float)((!t.flipX) ? 1 : (-1)); 
			}
			param.x = orgX;
			param.y = orgY;

@@ -3005,12 +2797,12 @@ public virtual void DrawTile()

cs
			}
		}
	}
	orgY += num24; 
	orgY += num22; 
	if (detail.charas.Count <= 0)
	{
		return;
	}
	param.shadowFix = 0f - num25; 
	param.shadowFix = 0f - num23; 
	param.color += 1310720f;
	float max = zSetting.max2;
	for (int n = 0; n < detail.charas.Count; n++)

@@ -3035,9 +2827,9 @@ public virtual void DrawTile()

cs
				{
					Vector3 position = restrainer.owner.renderer.position;
					float defCharaHeight = EMono.setting.render.defCharaHeight;
					float num30 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height); 
					float num28 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height); 
					_actorPos.x = position.x + getRestrainPos.x * (float)((restrainer.owner.dir % 2 == 0) ? 1 : (-1));
					_actorPos.y = position.y + num30; 
					_actorPos.y = position.y + num28; 
					_actorPos.z = position.z + getRestrainPos.z;
					param.liquidLv = 0;
					param.shadowFix = orgY - _actorPos.y;

@@ -3052,22 +2844,22 @@ public virtual void DrawTile()

cs
		{
			if (chara.IsDeadOrSleeping && chara.IsPCC)
			{
				float num31 = chara.renderer.data.size.y * 0.3f; 
				float num29 = chara.renderer.data.size.y * 0.3f; 
				if (thingPos.y > max)
				{
					thingPos.y = max;
				}
				float num32 = thingPos.y + num31; 
				float num33 = (float)n * -0.01f; 
				if (num32 > zSetting.thresh1) 
				float num30 = thingPos.y + num29; 
				float num31 = (float)n * -0.01f; 
				if (num30 > zSetting.thresh1) 
				{
					num33 = zSetting.mod1; 
					num31 = zSetting.mod1; 
				}
				_actorPos.x += thingPos.x;
				_actorPos.y += thingPos.y;
				_actorPos.z += renderSetting.laydownZ + num33; 
				_actorPos.z += renderSetting.laydownZ + num31; 
				param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
				thingPos.y += num31 * 0.8f; 
				thingPos.y += num29 * 0.8f; 
				chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
			}
			else

@@ -3087,10 +2879,10 @@ public virtual void DrawTile()

cs
				}
				if (!chara.IsPC && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
				{
					_actorPos += renderSetting.charaPos[1 + ((num21 < 4) ? num21 : 3)]; 
					_actorPos += renderSetting.charaPos[1 + ((num19 < 4) ? num19 : 3)]; 
				}
				_actorPos.z += 0.01f * (float)n + renderSetting.charaZ;
				num21++; 
				num19++; 
				if (flag10)
				{
					_actorPos.z += chara.renderer.data.hangedFixZ;

@@ -3103,13 +2895,221 @@ public virtual void DrawTile()

cs
		param.z = orgZ;
	}
	return;
	IL_6f59: 
	if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null) 
	IL_6fc9: 
	if (this.cell.effect != null) 
	{
		param.tile = num12; 
		rendererFov.Draw(param); 
		if (this.cell.effect.IsLiquid) 
		{ 
			SourceCellEffect.Row sourceEffect = this.cell.sourceEffect; 
			SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial; 
			tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4; 
			param.tile = tile + this.cell.sourceEffect._tiles[0]; 
			param.mat = defaultMaterial; 
			param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color); 
			sourceEffect.renderData.Draw(param); 
		} 
		else
		{ 
			param.tile = this.cell.effect.source._tiles[0]; 
			SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect; 
			if (sourceEffect2.anime.Length != 0) 
			{ 
				if (sourceEffect2.anime.Length > 2) 
				{ 
					float num32 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2]; 
					if (!(num32 >= (float)sourceEffect2.anime[0])) 
					{ 
						param.tile += num32; 
					} 
				} 
				else
				{ 
					float num33 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0]; 
					param.tile += num33; 
				} 
			} 
			if (this.cell.effect.IsFire) 
			{ 
				rendererEffect.Draw(param); 
			} 
			else
			{ 
				this.cell.effect.source.renderData.Draw(param); 
			} 
		} 
	} 
	param.color = floorLight; 
	if (this.cell.critter != null) 
	{ 
		Critter critter = this.cell.critter; 
		int snowTile = critter.tile; 
		if (snowed && critter.SnowTile != 0) 
		{ 
			critter.x = 0.06f; 
			critter.y = -0.06f; 
			snowTile = critter.SnowTile; 
		} 
		else
		{ 
			critter.Update(); 
		} 
		pass = passObjSS; 
		batch = pass.batches[pass.batchIdx]; 
		batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f; 
		batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f; 
		batch.matrices[pass.idx].m23 = param.z; 
		batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1)); 
		batch.colors[pass.idx] = floorLight; 
		pass.idx++; 
		if (pass.idx == pass.batchSize) 
		{ 
			pass.NextBatch(); 
		} 
	} 
	if (detail != null) 
	{ 
		TransAnime anime3 = detail.anime; 
		if (anime3 != null && !anime3.animeBlock) 
		{ 
			TransAnime anime4 = detail.anime; 
			param.x += anime4.v.x; 
			param.y += anime4.v.y; 
			param.z += anime4.v.z; 
		} 
	} 
	if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap) 
	{ 
		SourceObj.Row sourceObj = this.cell.sourceObj; 
		if (!snowed || sourceObj.snowTile <= 0) 
		{ 
			param.snow = snowed; 
			param.mat = this.cell.matObj; 
			orgY = param.y; 
			if (param.liquidLv > 0) 
			{ 
				if (sourceObj.pref.Float) 
				{ 
					param.y += 0.01f * floatY; 
					if (liquidLv > 10) 
					{ 
						liquidLv = TileType.FloorWaterShallow.LiquidLV * 10; 
					} 
					liquidLv -= (int)(floatY * 0.5f); 
					param.liquidLv = liquidLv; 
				} 
				if (sourceObj.tileType.IsWaterTop) 
				{ 
					param.liquidLv = 0; 
				} 
				else
				{ 
					param.liquidLv += sourceObj.pref.liquidMod; 
					if (param.liquidLv < 1) 
					{ 
						param.liquid = 1f; 
					} 
					else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax) 
					{ 
						param.liquidLv = 99 + sourceObj.pref.liquidModMax; 
					} 
				} 
			} 
			if (sourceObj.useAltColor) 
			{ 
				param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod)); 
			} 
			else
			{ 
				param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod)); 
			} 
			if (sourceObj.HasGrowth) 
			{ 
				this.cell.growth.OnRenderTileMap(param); 
			} 
			else
			{ 
				if (this.cell.autotileObj != 0) 
				{ 
					param.tile = sourceObj._tiles[0] + this.cell.autotileObj; 
				} 
				else if (sourceObj.tileType.IsUseBlockDir) 
				{ 
					param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length]; 
				} 
				else
				{ 
					param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length]; 
				} 
				if (_lowblock && sourceObj.tileType.IsSkipLowBlock) 
				{ 
					param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000; 
				} 
				orgY = param.y; 
				orgZ = param.z; 
				param.y += sourceObj.pref.y; 
				param.z += sourceObj.pref.z; 
				sourceObj.renderData.Draw(param); 
				param.y = orgY; 
				param.z = orgZ; 
				int shadow4 = sourceObj.pref.shadow; 
				if (shadow4 > 1 && !this.cell.ignoreObjShadow) 
				{ 
					passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow4], sourceObj.pref, 0, param.snow); 
				} 
				param.y = orgY; 
			} 
		} 
	} 
	if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood) 
	{ 
		passDecal.Add(param, (int)this.cell.decal, floorLight); 
	} 
	if (highlightCells) 
	{ 
		switch (ActionMode.FlagCell.mode) 
		{ 
		case AM_FlagCell.Mode.flagWallPillar: 
			if (this.cell.isToggleWallPillar) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		case AM_FlagCell.Mode.flagSnow: 
			if (this.cell.isClearSnow) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		case AM_FlagCell.Mode.flagFloat: 
			if (this.cell.isForceFloat) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		case AM_FlagCell.Mode.flagClear: 
			if (this.cell.isClearArea) 
			{ 
				passArea.Add(param, 34f, 0f); 
			} 
			break; 
		} 
	} 
	if (detail == null) 
	{ 
		return; 
	} 
	if (highlightArea && detail.area != null) 
	{ 
		passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f); 
	} 
	if (detail.footmark != null && sourceFloor.id != 0) 
	{ 
		param.tile = detail.footmark.tile; 
		param.mat = matFloor; 
		param.matColor = 104025f; 
		renderFootmark.Draw(param); 
	}
	goto IL_6fb9; 
	goto IL_7a73; 
	void Draw(int tile)
	{
		pass = passEdge;

CardRenderer

@@ -230,7 +230,10 @@ public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)

cs
		}
		int shadow = pref.shadow;
		bool flag2 = isChara && owner.isHidden && !EClass.pc.canSeeInvisible && (!EClass.pc.hasTelepathy || !owner.Chara.race.visibleWithTelepathy);
		p.x += pref.x * (float)((!owner.flipX) ? 1 : (-1)); 
		if (isChara) 
		{ 
			p.x += pref.x * (float)((!owner.flipX) ? 1 : (-1)); 
		} 
		p.y += pref.y;
		if (drawShadow && shadow != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC))
		{

HitSummary

@@ -24,6 +24,7 @@ public void Clear()

cs
		money = (count = (countValid = 0));
		targets.Clear();
		groups.Clear();
		SetRecipe(recipe); 
	}

	public void SetRecipe(Recipe r)

@@ -33,7 +34,7 @@ public void SetRecipe(Recipe r)

cs
	if (r != null && !r.UseStock && r.source.NeedFactory)
	{
		PropSet propSet = EClass._map.Installed.cardMap.TryGetValue(r.source.idFactory);
		if (propSet == null || propSet.Count == 0) 
		if ((propSet == null || propSet.Count == 0) && EClass.pc.things.Find((Thing t) => t.id == r.source.idFactory) == null) 
		{
			hasFactory = false;
		}

TraitBrewery

@@ -91,7 +91,7 @@ public override bool OnChildDecay(Card c, bool firstDecay)

cs
		{
			return false;
		}
		c = ThingGen.Create(productID).SetNum(num2); 
		c = ((!thing.isCopy) ? ThingGen.Create(productID).SetNum(num2) : ThingGen.Create("ash3").SetNum(Mathf.Min(num2, 10))); 
		break;
	}
	default:

UIInventory

@@ -773,10 +773,23 @@ public void RefreshMenu()

cs
					uIContextMenu7.Show();
				});
			}
			if (EMono.core.config.game.advancedMenu) 
			{ 
				UIContextMenu uIContextMenu8 = uIContextMenu.AddChild("anchor"); 
				foreach (RectPosition p in Util.EnumToList<RectPosition>()) 
				{ 
					uIContextMenu8.AddButton(((data.customAnchor == p) ? "★ " : "") + p.ToString().lang(), delegate
					{ 
						data.customAnchor = p; 
						window.UpdateSaveData(); 
						SE.ClickGeneral(); 
					}); 
				} 
			} 
			if (EMono.debug.enable)
			{
				UIContextMenu uIContextMenu8 = uIContextMenu.AddChild("debug", TextAnchor.UpperRight); 
				uIContextMenu8.AddToggle("toggleGrid", EMono.core.config.game.useGrid, delegate(bool a) 
				UIContextMenu uIContextMenu9 = uIContextMenu.AddChild("debug", TextAnchor.UpperRight); 
				uIContextMenu9.AddToggle("toggleGrid", EMono.core.config.game.useGrid, delegate(bool a) 
				{
					EMono.core.config.game.useGrid = a;
					foreach (LayerInventory item4 in LayerInventory.listInv)

@@ -785,7 +798,7 @@ public void RefreshMenu()

cs
						item4.invs[0].RefreshGrid();
					}
				});
				uIContextMenu8.AddSlider("iconSize", (float a) => a.ToString() ?? "", EMono.game.config.gridIconSize, delegate(float b) 
				uIContextMenu9.AddSlider("iconSize", (float a) => a.ToString() ?? "", EMono.game.config.gridIconSize, delegate(float b) 
				{
					EMono.game.config.gridIconSize = (int)b;
					RefreshGrid();

UIRecipeInfo

@@ -305,7 +305,7 @@ public void Refresh()

cs
		if (!r.UseStock && r.source.NeedFactory)
		{
			PropSet propSet = EMono._map.Installed.cardMap.TryGetValue(r.source.idFactory);
			if (propSet == null || propSet.Count == 0) 
			if ((propSet == null || propSet.Count == 0) && EMono.pc.things.Find((Thing t) => t.id == r.source.idFactory) == null) 
			{
				note.Space(8);
				note.AddText("noFactory".lang(r.source.NameFactory), FontColor.Bad);

Widget

@@ -445,8 +445,8 @@ protected void ClampToScreen(RectTransform rect, float margin = 10f)

cs
		Vector2 vector2 = new Vector2((float)Screen.width - margin, (float)Screen.height - margin);
		Vector3 vector3 = vector - rect.rect.min;
		Vector3 vector4 = vector2 - rect.rect.max;
		position.x = (int)Mathf.Clamp(position.x, vector3.x - 20f, vector4.x + 20f); 
		position.y = (int)Mathf.Clamp(position.y, vector3.y - 20f, vector4.y + 20f); 
		position.x = Mathf.Clamp(position.x, vector3.x - 20f, vector4.x + 20f); 
		position.y = Mathf.Clamp(position.y, vector3.y - 20f, vector4.y + 20f); 
		rect.position = position;
	}
}