diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index f1e55c902..fb05bd52b 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -312,8 +312,13 @@ FString level_info_t::LookupLevelName() { mysnprintf (checkstring, countof(checkstring), "%d: ", atoi(&MapName[5])); } + else + { + // make sure nothing is stripped. + checkstring[0] = '\0'; + } thename = strstr (lookedup, checkstring); - if (thename == NULL) + if (thename == NULL || thename == lookedup) { thename = lookedup; } diff --git a/src/p_tags.cpp b/src/p_tags.cpp index e773b691f..851c4ee94 100644 --- a/src/p_tags.cpp +++ b/src/p_tags.cpp @@ -309,13 +309,24 @@ int FSectorTagIterator::Next() ret = start; start = -1; } - else + else if (searchtag != 0) { while (start >= 0 && tagManager.allTags[start].tag != searchtag) start = tagManager.allTags[start].nexttag; if (start == -1) return -1; ret = tagManager.allTags[start].target; start = tagManager.allTags[start].nexttag; } + else + { + // with the tag manager, searching for tag 0 has to be different, because it won't create entries for untagged sectors. + while (start < numsectors && tagManager.SectorHasTags(start)) + { + start++; + } + if (start == numsectors) return -1; + ret = start; + start++; + } return ret; } diff --git a/src/p_tags.h b/src/p_tags.h index 2195821c1..75d397d8d 100644 --- a/src/p_tags.h +++ b/src/p_tags.h @@ -79,7 +79,7 @@ public: FSectorTagIterator(int tag) { searchtag = tag; - start = tagManager.TagHashFirst[((unsigned int)tag) % FTagManager::TAG_HASH_SIZE]; + start = tag == 0 ? 0 : tagManager.TagHashFirst[((unsigned int)tag) % FTagManager::TAG_HASH_SIZE]; } // Special constructor for actions that treat tag 0 as 'back of activation line' diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index be9c06d60..941aa0a59 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -6238,8 +6238,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHigherOrLower) // // A_SetRipperLevel(int level) // -// Sets the ripper level/requirement of the calling actor. -// Also sets the minimum and maximum levels to rip through. +// Sets the ripper level of the calling actor. //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipperLevel) { @@ -6253,8 +6252,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipperLevel) // // A_SetRipMin(int min) // -// Sets the ripper level/requirement of the calling actor. -// Also sets the minimum and maximum levels to rip through. +// Sets the minimum level a ripper must be in order to rip through this actor. //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMin) { @@ -6266,10 +6264,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMin) //=========================================================================== // -// A_SetRipMin(int min) +// A_SetRipMax(int max) // -// Sets the ripper level/requirement of the calling actor. -// Also sets the minimum and maximum levels to rip through. +// Sets the minimum level a ripper must be in order to rip through this actor. //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMax) {