边缘世界 RimWorld

边缘世界 RimWorld

Forsaken Faction For Alpha Genes
 此主题已被置顶,因此可能具有重要性
Matsay  [开发者] 2024 年 11 月 18 日 上午 1:19
BUG REPORTS
You know the drill. Report bugs here, try to join a log as it makes troubleshooting much more easier, yadda yadda.
< >
正在显示第 1 - 2 条,共 2 条留言
Dibolic 9 月 6 日 下午 2:15 
Hello, I am not sure if the issue I encounter is on you side or on the other mod side.
I use Simple Improve https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3538863870 that adds an improve job for building, like a basic wooden chair. When I click to order a pawn to improve the building I got the following error

Exception in WorkGiverOptionProvider_WorkGivers.GetWorkGiversOptionsFor for WorkGiver_Improve: System.NullReferenceException: Object reference not set to an instance of an object [Ref 94621A96] at ForsakenFaction.FOF_CanConstruct_Postfix.Postfix (System.Boolean __result, Verse.Thing t, Verse.Pawn p, Verse.JobDef jobForReservation) [0x00007] in <6ac944cfd9264e2db54159419bbf016e>:0 at RimWorld.GenConstruct.CanConstruct (Verse.Thing t, Verse.Pawn p, System.Boolean checkSkills, System.Boolean forced, Verse.JobDef jobForReservation) [0x00520] in <24d25868955f4df08b02c73b55f389fe>:0

In Simple Improve side, it seems the caller code is, and check for pawn skill level depending of targeted quality:
if (!GenConstruct.CanConstruct(thing, pawn, true, forced)) return null;

I got a look in the included source code for both mods but I am unable to tell where is the issue

I can reproduce the issue by loading a dev test with only the involved mods: base game and official DLCs, your mod and its dependencies and Simple Improve (requiring only Harmony); and trying to improve quality of a wooden stool.

Can you have a look?
Dibolic 10 月 4 日 上午 12:30 
I eventually got my hands into the code and find a solution.

t.def.entityDefToBuild
may not exist in some situations, like with Simple Improve action.
Adding null safe navigation of Thing properties fix the NRE from your mod.

< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50