Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
If you give me a way to reproduce the issue, i will have a look.
And without a full log I dont even know which mod or RW version you are using...
Mod pack at https://steamproxy-script.pipiskins.com/sharedfiles/filedetails/stats/3507289931
Note I already dropped Priority Treatment as it's a live mod pack so no more of these errors, so very likely something is up with PT
Exception in CheckCurrentToilEndOrFail for pawn Alyona driver=JobDriver_TendPatient (toilIndex=3)
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
if medicine is null from FindBestMedicine(pawn, sickPawn, useOnlyInventory=false) my priority treatment creates a job without the medicine argument.
JobMaker.MakeJob(JobDefOf.TendPatient, sickPawn); //no medicine passed
Perhaps the toil has to do with missing that argument?
Of course, when I run in a simple environment w/ just your and my mods (and a few other cores) I can't reproduce.
If the first hediff in vanilla gets tended without medicine, all following hediffs tended during the treatment get tended without medicine as well.
So I had to interrupt that. Thats what the postfix is doing.
Eventually there is a better way, but just doing a postfix was easier than doing a transpiler... But I will have another look.
But since it is not reproducible with PT and CYM, the cause is most likely another mod?
Doesnt the following mean the index was out of range in "ChooseYourMedicine.Utility_GetList.GetTheCorrectMedicalCareCategory" ?
Exception in CheckCurrentToilEndOrFail for pawn Alyona driver=JobDriver_TendPatient (toilIndex=3)
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
[Ref 2427D69C]
at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
at ChooseYourMedicine.Utility_GetList.GetTheCorrectMedicalCareCategory (Verse.Pawn patient) [0x000bb] in <968e7ca299844c77acc981c94d990af2>:0 #
...
I have two methods with that name that have different parameters:
One is "GetTheCorrectMedicalCareCategory(Pawn patient, out bool useDetailed)"
the other is "GetTheCorrectMedicalCareCategory(Pawn patient, Hediff firstTendedHediff, out bool useDetailed)"
The method in the stacktrace has only one parameter, so it is the first one that causes the issue? Because the out parameter is somehow ignored?
The method loops through all hediffs and adds the tendable ones to a list, then sorts them by priority, then calls the method with the same name with the parameter listOfTendableHediffs[0].
If there is no tendable hediffs, then the list is empty and we get indexOutOfRange.
I mean... The method should never have been called if there is no tendable hediffs...
I checked the toils postfix again and as long as PriorityTreatment does not add new toils to the job TendPatient, then it should not cause issues.
I will update asap and fix the possible issue mentioned above, but besides that I dont know what may cause the errors.
If it is not fixed, I guess we have to wait for a way to reproduce the issue...