边缘世界 RimWorld

边缘世界 RimWorld

Tech Raiding [1.0]
Montoya Por Favor!! 2018 年 10 月 23 日 下午 11:53
Compability with High Tech Laboratory Facility mod
Hi so I use this with High Tech Laboratory Facility mod and they don't work together. I take a look into your code and find that in the patch operation, you use xpath with hard-coded value in it:
*/ThingDef[defName = "HiTechResearchBench"]/comps/li[3]/linkableFacilities
Doing it this way can easily breaks your mod since other mod may modify the xml, just like High Tech Laboratory Facility mod does, and hard-coded value will no longer work.
My fix is that instead of using current xpath, you can have your xpath like this:
*/ThingDef[defName = "HiTechResearchBench"]//linkableFacilities
This xpath means that it will target every linkableFacilities tags under ThingDef (every descendants, not limited to direct children). So that you eliminate the usage of hard-coded value like li[3] and make the code more flexible.
最后由 Montoya Por Favor!! 编辑于; 2018 年 10 月 23 日 下午 11:54
< >
正在显示第 1 - 2 条,共 2 条留言
Skoots  [开发者] 2018 年 12 月 26 日 下午 4:26 
I am in the process of writing an update for this mod, however after a computer crash I have lost a lot of sources so I may have to make a new post to get the mod update on the workshop.

Would you mind if I used this in the update for the mod? I will be sure to give you a special thanks for such a handy fix!
最后由 Skoots 编辑于; 2018 年 12 月 26 日 下午 4:26
Montoya Por Favor!! 2018 年 12 月 30 日 上午 9:41 
sure go for it. Glad I could help :)
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50