RimWorld

RimWorld

Giant crop
Giant crop – "Got ThingsListAt out of bounds" when giant plant is at map edge
Hi, I encountered an error in Giant crop on RW 1.6.

Error:
Got ThingsListAt out of bounds: (250, 0, 172)
Verse.ThingGrid.ThingsListAt(IntVec3 c)
Verse.GridsUtility.GetPlant(IntVec3 c, Map map)
LingGiantCrop.Comp_GiantCrop.CompTickLong()

It seems the mod calls GetPlant() on a cell outside the map boundaries.
My map size is 250x250, so valid X range is 0–249, but the code checks X=250 (off-by-one).
Likely happens when a giant crop is planted at the eastern or northern map border, and CompTickLong looks at a neighbouring cell without InBounds(map) check.

**How to reproduce:**
1. Plant a giant crop adjacent to the east/north map edge.
2. Wait for growth ticks.
3. Log will spam the error above.

**Possible fix:**
Before calling ThingsListAt or GetPlant, ensure:
```csharp
if (!cell.InBounds(parent.Map)) return;

Thanks for your work on the mod!
< >
Showing 1-3 of 3 comments
LingLuo  [developer] 10 Aug @ 9:47am 
Please avoid actively planting crops at the edge of the map first. I will try to fix this bug
Got ThingsListAt out of bounds: (182, 0, 250)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch2 (string)
Verse.Log:ErrorOnce (string,int)
Verse.ThingGrid:ThingsListAt (Verse.IntVec3)
Verse.GridsUtility:GetPlant (Verse.IntVec3,Verse.Map)
LingGiantCrop.Comp_GiantCrop:CompTickLong ()
Verse.ThingWithComps:TickLong ()
RimWorld.Plant:TickLong ()
Verse.Thing:DoTick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickList.Tick_Patch1 (Verse.TickList)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch3 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Game.UpdatePlay_Patch3 (Verse.Game)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root_Play.Update_Patch1 (Verse.Root_Play)
I have a similar error:

Got ThingsListAt out of bounds: (57, 0, -1)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch3 (string)
Verse.Log:ErrorOnce (string,int)
Verse.ThingGrid:ThingsListAt (Verse.IntVec3)
Verse.GridsUtility:GetPlant (Verse.IntVec3,Verse.Map)
LingGiantCrop.Comp_GiantCrop:CompTickLong ()
Verse.ThingWithComps:TickLong ()
RimWorld.Plant:TickLong ()
Verse.Thing:DoTick ()
Verse.TickList:Tick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch3 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Game.UpdatePlay_Patch1 (Verse.Game)
Verse.Root_Play:Update ()

I have no idea why the mod tries to access negative Z coordinate. Does the game even have Z coordinates?
BTW I haven't planted anything, the problem fired on devtest mode. It happens every time.
< >
Showing 1-3 of 3 comments
Per page: 1530 50