Sets the corresponding value from dungeonList but first performs a check whether the indices are in range.