nwnxee / unified

Binaries available under the Releases tab on Github
https://nwnxee.github.io/unified
GNU General Public License v3.0
129 stars 92 forks source link

ActionJumpToLocation Crashes server with PRC Ninja Class #1760

Open deltreey opened 2 months ago

deltreey commented 2 months ago

I have already contacted the PRC team, and I'm not sure why the Ninja class is specifically triggering this. I have a simple script that moves players who've been logged off for a while back to the start area on our PW server. For some reason, this trigger is causing this error which crashes my server:

 NWNX Signal Handler:
==============================================================
 NWNX 8193.36-12 (2f732e7) has crashed. Fatal error: Segmentation fault (11).
 Please file a bug at https://github.com/nwnxee/unified/issues
==============================================================

  Backtrace:
    /nwn/nwnx/NWNX_Core.so(_ZN7NWNXLib8Platform13GetStackTraceB5cxx11Eh+0x3b) [0x7f5b176e74fb]
    /nwn/nwnx/NWNX_Core.so(nwnx_signal_handler+0xac) [0x7f5b17694abc]
    /lib/x86_64-linux-gnu/libc.so.6(+0x37970) [0x7f5b17183970]
    ./nwserver(_ZN22CNWSAreaOfEffectObject18RemoveFromSubAreasEi+0x42) [0x55f5aeb05e02]
    ./nwserver(_ZN22CNWSAreaOfEffectObject11JumpToPointEP8CNWSAreaRK6Vector+0x70) [0x55f5aeb06f80]
    ./nwserver(_ZN12CNWSCreature28UpdateSubareasOnJumpPositionE6Vectorj+0xdb) [0x55f5aea2b41b]
    ./nwserver(_ZN12CNWSCreature19AIActionJumpToPointEP20CNWSObjectActionNode+0x31d) [0x55f5aea2c02d]
    ./nwserver(_ZN10CNWSObject10RunActionsEjjm+0xc55) [0x55f5aeac3075]
    ./nwserver(_ZN12CNWSCreature8AIUpdateEv+0x15e) [0x55f5aea06ffe]
    ./nwserver(_ZN15CServerAIMaster11UpdateStateEv+0x58d) [0x55f5aeb1c5fd]
    /nwn/nwnx//NWNX_Profiler.so(_ZN8Profiler15AIMasterUpdates14AIMasterUpdateEP15CServerAIMaster+0x716) [0x7f5b14e04986]
    /nwn/nwnx//NWNX_Profiler.so(+0x17683) [0x7f5b14e03683]
    ./nwserver(_ZN21CServerExoAppInternal8MainLoopEv+0x8ac) [0x55f5aeb3141c]
    /nwn/nwnx//NWNX_Profiler.so(+0x18ed3) [0x7f5b14e04ed3]
    /nwn/nwnx//NWNX_Profiler.so(_ZN8Profiler8Profiler14MainLoopUpdateEP21CServerExoAppInternal+0x3d) [0x7f5b14dfe6ed]
    /nwn/nwnx//NWNX_ThreadWatchdog.so(_ZN14ThreadWatchdog14ThreadWatchdog14MainLoopUpdateEP21CServerExoAppInternal+0x31) [0x7f5b0ff99991]
    /nwn/nwnx//NWNX_Tracking.so(_ZN8Tracking8Activity14MainLoopUpdateEP21CServerExoAppInternal+0x44) [0x7f5b0ff60454]
    ./nwserver(main+0x13f5) [0x55f5ae7ee8f5]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f5b1717009b]
    ./nwserver(_start+0x2a) [0x55f5ae7f343a]

For reference, this is the PRC Ninja class heartbeat script. Not sure if it will help:

#include "prc_inc_clsfunc"

void Ninja_GhostSight (object oPC, int bOn=TRUE)
{
    if (bOn)
    {
        effect eSeeInvis = SupernaturalEffect(EffectSeeInvisible());
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSeeInvis, oPC);
    }
    else
    {
        effect eCheck = GetFirstEffect(oPC);
        while(GetIsEffectValid(eCheck))
        {

            if ((GetEffectCreator(eCheck) == oPC) &&
                (GetEffectType(eCheck) == EFFECT_TYPE_SEEINVISIBLE) &&
                (GetEffectSubType(eCheck) == SUBTYPE_SUPERNATURAL))
            {
            // Remove the effect as it was created by us and is hopefully the right one
                RemoveEffect(oPC, eCheck);
                break;
            }
            eCheck = GetNextEffect(oPC);
        }
    }    
}

void main()
{
    object oPC = OBJECT_SELF;
    object oSkin = GetPCSkin(oPC);
    // all Ki powers will not function when wearing armor or encumbered
    int bEnabled = Ninja_AbilitiesEnabled(oPC);

    // determine which passive Ninja feats the char has
    int bKiPower = GetHasFeat(FEAT_KI_POWER, oPC) && bEnabled;
    int bAcro  = GetHasFeat(FEAT_ACROBATICS_2, oPC) ? 2 : 0;
    bAcro  = GetHasFeat(FEAT_ACROBATICS_4, oPC) ? 4 : bAcro;
    bAcro  = GetHasFeat(FEAT_ACROBATICS_6, oPC) ? 6 : bAcro;
    bAcro  = GetHasFeat(FEAT_EPIC_ACROBATICS_8, oPC) ? 8 : bAcro;
    bAcro  = GetHasFeat(FEAT_EPIC_ACROBATICS_10, oPC) ? 10 : bAcro;
    bAcro  = GetHasFeat(FEAT_EPIC_ACROBATICS_12, oPC) ? 12 : bAcro;
    if (!bEnabled)
        SendMessageToPC(oPC, "Your Ninja abilities are disabled because of encumbrance or armor.");

    Ninja_GhostSight(oPC, GetHasFeat(FEAT_GHOST_SIGHT, oPC));
    if (bKiPower)
        SetCompositeBonus(oSkin, "KiPowerWillBonus", 2, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC, IP_CONST_SAVEBASETYPE_WILL);
    else
        SetCompositeBonus(oSkin, "KiPowerWillBonus", 0, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC, IP_CONST_SAVEBASETYPE_WILL);
[10:13 PM]
    if ((GetLevelByClass(CLASS_TYPE_MONK, oPC) > 0) || !bEnabled)
    {
        SetCompositeBonus(oSkin, "NinjaACBonus", 0, ITEM_PROPERTY_AC_BONUS);
    //    SendMessageToPC(oPC, "Setting to 0. Disabled.");
    }
    else
    {
        SetCompositeBonus(oSkin, "NinjaACBonus", GetAbilityModifier(ABILITY_WISDOM, oPC), ITEM_PROPERTY_AC_BONUS);
    //    SendMessageToPC(oPC, "Setting to "+IntToString(GetAbilityModifier(ABILITY_WISDOM, oPC)));
    }
    if (bAcro)
    {
        SetCompositeBonus(oSkin, "AcroJumpBonus", bAcro, ITEM_PROPERTY_SKILL_BONUS, SKILL_JUMP);
        SetCompositeBonus(oSkin, "AcroTumbBonus", bAcro, ITEM_PROPERTY_SKILL_BONUS, SKILL_TUMBLE);
    }
    else
    {
        SetCompositeBonus(oSkin, "AcroJumpBonus", 0, ITEM_PROPERTY_SKILL_BONUS, ITEM_PROPERTY_SKILL_BONUS);
        SetCompositeBonus(oSkin, "AcroTumbBonus", 0, ITEM_PROPERTY_SKILL_BONUS, ITEM_PROPERTY_SKILL_BONUS);
    }
}