diff --git a/code/controllers/subsystem/persistence/engravings.dm b/code/controllers/subsystem/persistence/engravings.dm index f47fc7fbba1..6808a101bb8 100644 --- a/code/controllers/subsystem/persistence/engravings.dm +++ b/code/controllers/subsystem/persistence/engravings.dm @@ -27,7 +27,7 @@ var/successfully_loaded_engravings = 0 - for(var/iteration in 1 to rand(MIN_PERSISTENT_ENGRAVINGS, MAX_PERSISTENT_ENGRAVINGS)) + for(var/iteration in 1 to min(rand(MIN_PERSISTENT_ENGRAVINGS, MAX_PERSISTENT_ENGRAVINGS), saved_engravings.len)) var/engraving = pick_n_take(saved_engravings) if(!islist(engraving)) stack_trace("something's wrong with the engraving data! one of the saved engravings wasn't a list!")