From 867d522879f98f6f5b0f227a80ec257eddd4c8ed Mon Sep 17 00:00:00 2001 From: ac-stef Date: Mon, 29 Aug 2016 13:44:58 +0200 Subject: [PATCH] fix crash on used but unassigned slots during config slot sorting maybe we should have a warning for such entities... --- source/src/audiomanager.cpp | 2 +- source/src/rendermodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/src/audiomanager.cpp b/source/src/audiomanager.cpp index e9f0c8af..7fe21a14 100644 --- a/source/src/audiomanager.cpp +++ b/source/src/audiomanager.cpp @@ -1009,7 +1009,7 @@ void sortmapsoundslots(char **args, int numargs) tempslots.last().oldslot.add(i); tempslots.last().used = false; } - loopv(ents) if(ents[i].type == SOUND) tempslots[ents[i].attr1 & 255].used = true; + loopv(ents) if(ents[i].type == SOUND && tempslots.inrange(ents[i].attr1)) tempslots[ents[i].attr1].used = true; tempslots.sort(tempmssort); // remove double entries diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 9a382125..9501777f 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -255,7 +255,7 @@ void sortmapmodelslots(char **args, int numargs) tempslots.last().oldslot.add(i); tempslots.last().used = false; } - loopv(ents) if(ents[i].type == MAPMODEL) tempslots[ents[i].attr2].used = true; + loopv(ents) if(ents[i].type == MAPMODEL && tempslots.inrange(ents[i].attr2)) tempslots[ents[i].attr2].used = true; tempslots.sort(tempmmsort); // remove double entries