When using
ItemInsertRune, attempting to add a rune to an item that doesn't have a slot in the "_Slot" number specified will crash the editor.
For instance, the weapon "WPN_Cheat_Sword_1H_RuneSlot2" has 2 rune slots. Adding runes to slot 0 and 1 is fine, but attempting to add a rune to slot 2 (which it doesn't have) causes a crash.
This was traceable within osirislog.log, as the call was the last thing in the log:
ItemInsertRune( (CHARACTERGUID)NULL_00000000-0000-0000-0000-000000000000, (GUIDSTRING)(ITEMGUID)WPN_Common_Sword_1H_A2_6b6ce679-75f5-4c24-9c05-955b9178c378, (STRING)"LOOT_Rune_Masterwork_Large_7e16d9af-6865-4f0f-a67a-144b8ef2da26", (INTEGER)2 )
The crash dump had this exception:
Exception Code: 0xC0000005
Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Likewise, trying to add a rune to equipment with no rune slots resulted in a crash.
Additionally, the runes were being added shortly after an item was created, so I'm not sure if that factors into it, since the wiki mentions (for ItemInsertRune):
This call does nothing if _Item is invalid, _Template is not an item root template for a rune, or if _Slot is >= the number of rune slots in _Item.
____________________________
I was able to work around this by making sure to apply an empty rune slot deltamod before inserting the rune, but adding some sort of crash-safety in the call would be ideal.
The workaround involved matching an item type (weapon, armor (upperbody, arms, lowerbody, gloves, legs, amulet) to an associated empty slot deltamod:
Rune Crash Workaround