// Medical · RimWorld Mod
Dubs Bad Hygiene: StallDoorFix
Short Description: Fix the graphic issue (T shape) of stall door when dubs hygiene and rebuild are used together.
Short Description:
Fix the graphic issue (T shape) of stall door when dubs hygiene and rebuild are used together.
Also work for Dubs Bad Hygiene LITE:
Make sure you are using ONE OF THE FOLLOWING: Dubs Bad Hygiene OR Dubs Bad Hygiene Lite.
Detailed Descriptions
Rebuild gives a new perspective for doors in the game. Original patch of StallDoor in Rebuild raises a graphic issue (T shape) caused by Dubs Bad Hygiene. Currently, the patch for StallDoor is deleted in Rebuild Mod.
I re-added the patch for StallDoor and using transpiler to clean up some codes in DrawAt method in the class Building_StallDoor (from Dubs Bad Hygiene).
Now, Stall Door will have perspective door function in Rebuild working without giving T-Shape.
Technical Explanation
The issue there is a visual error in StallDoor is that this building has custom animation logic in its DrawAt method. However, in this method it also call base.DrawAt(). So in a naive way to understand this issue is that the drawing is called twice.
My way to fix this issue is to remove base.DrawAt call in DrawAt method of StallDoor. (This is done in the first version of this patch).
Since some comments saying that there is memory leak problem while using my mod, I investigated the cause. I guess some mods are using transpiler patch to find this base.DrawAt call and if they could not find the base.DrawAt then they may create a dead loop. Therefore, in the current version, instead of removing base.DrawAt() call, I use if-condition to hide this call. That is:
if original codes in the mod are:
```
base.DrawAt();
// Remaining Codes
```
Now the codes become:
```
if false {
base.DrawAt();
}
// Remaining Codes
```
Hope this can solve the memory leak issue. However, I should warn that this way for fixing is not the most performant since removing is more performant than hiding.
Credits
I used the original patch code and texture in Perspective Door Mod created by Owlchemist.
Since Dubs is too busy to fix his code, I temporarily upload this mod. Once Dubs decide to fix this problem, I will delete the mod.
Currently, I am trying to contact with the authors of Rebuild so that they could absorb this fix into Rebuild mod (Maybe in future you do not need to use this mod.)