Custom Hub Death Wish Fixer

#CustomActor

Makes it so mods with custom hubs set up will not allow you to return to them during a Death Wish.

A simple Actor that you place down in any map that needs it. It checks if any (non-passive) Death Wishes are active, and if any are, it sets the custom hub map variable in the map's MapInfo's ChapterInfo to an empty string. As a precaution, if there aren't any (non-passive) Death Wishes active, it'll check to make sure the name variable in the ChapterInfo is set to what it's supposed to be.

CustomHubDeathWishFixer.uc

[RAW] [Download]

/**
 *
 * Coded by supercoolsonic, 2022
 */
 
class CustomHubDeathWishFixer extends Actor
    placeable;
 
var() String CustomHubName;
 
event PostBeginPlay()
{
    local WorldInfo WI;
    local MapInfo MI;
    local Hat_ChapterInfo CI;
 
 
    WI = class'WorldInfo'.static.GetWorldInfo();
 
    if (WI == None)
        return;
 
    MI = WI.GetMapInfo();
 
    if (MI == None || Hat_MapInfo(MI) == None)
        return;
 
    CI = Hat_MapInfo(MI).ChapterInfo;
 
    if (CI == None)
        return;    
 
    if (class'Hat_SnatcherContract_DeathWish'.static.IsAnyActive(false))
        CI.HUBMapName = "";
 
    else if (CI.HUBMapName != CustomHubName)
        CI.HUBMapName = CustomHubName;
 
}
 
defaultproperties
{
    Begin Object Class=SpriteComponent Name=Sprite
        Sprite=Texture2D'EditorResources.LookTarget'
        Scale=0.05
        HiddenGame=true
        HiddenEditor=false
        AlwaysLoadOnClient=False
        AlwaysLoadOnServer=False
        SpriteCategoryName="TargetPoint"
    End Object
    Components.Add(Sprite)
 
    CustomHubName = "EnterHubNameHere";
}