Editor Crash:: if (GetNumber() == NAME_NO_NUMBER_INTERNAL)

Looping ItemIDArray to spawn items, if the item type weapon is selected to spawn so spawn the related ammo for that weapon and remove the first item in the array if the item is not a weapon to make space for ammo item to be spawned.
The array size is fixed according to the item count during looping.
if the first item is not removed in the array which is not a weapon, the loop will return array out of bound