I was looking at the decompiled source for DamageWorker.ExplosionCellsToHit and I noticed that in the second loop, it only adds cells to adjWallCells if adjWallCells already contains that cell. Since adjWallCells starts out empty, this means that the second loop will never do anything. Not sure if this has any ingame effects, but it seems like it must be a bug - I suspect the intent was to check that adjWallCells does *not* already contain the cell.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages1
#2
Bugs / [1.2.2723] (modding issue) ThingComp.PostDestroy is passed null previousMap
September 04, 2020, 05:46:42 PM
Repro steps:
1. In a mod dll, define a subclass of ThingComp and override PostDestroy. To make the bug obvious, you could have the method try to make use of the "previousMap" parameter e.g. by spawning something on that map.
2. Attach the comp to a Pawn, e.g. by xml patching it into the comps list of some existing pawn type. Here's my XML that patches a comp into every pawn in the game:
3. Kill a pawn with the dev tools
Expected: previousMap refers to the map on which the pawn was just before being destroyed. Actual: previousMap is null
1. In a mod dll, define a subclass of ThingComp and override PostDestroy. To make the bug obvious, you could have the method try to make use of the "previousMap" parameter e.g. by spawning something on that map.
Code Select
GenPlace.TryPlaceThing(ThingMaker.MakeThing(ThingDefOf.Silver), parent.Position, previousMap, ThingPlaceMode.Near);
2. Attach the comp to a Pawn, e.g. by xml patching it into the comps list of some existing pawn type. Here's my XML that patches a comp into every pawn in the game:
Code Select
<Patch>
<Operation Class="PatchOperationConditional">
<xpath>/Defs/ThingDef/category[text() = 'Pawn']/../comps</xpath>
<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef/category[text() = 'Pawn']/..</xpath>
<value>
<comps>
<li>
<compClass>MyMod.MyComp</compClass>
</li>
</comps>
</value>
</nomatch>
<match Class="PatchOperationAdd">
<xpath>/Defs/ThingDef/category[text() = 'Pawn']/../comps</xpath>
<value>
<li>
<compClass>MyMod.MyComp</compClass>
</li>
</value>
</match>
</Operation>
</Patch>
3. Kill a pawn with the dev tools
Expected: previousMap refers to the map on which the pawn was just before being destroyed. Actual: previousMap is null
Pages1