Open Aschent89 opened 1 year ago
What about using vanilla nwn functions to equip?
int iSlots = INVENTORY_SLOT_HEAD & INVENTORY_SLOT_BOOTS & INVENTORY_SLOT_ARMS & INVENTORY_SLOT_BELT & INVENTORY_SLOT_CARMOUR &
INVENTORY_SLOT_CHEST & INVENTORY_SLOT_CLOAK & INVENTORY_SLOT_CWEAPON_B & INVENTORY_SLOT_CWEAPON_L & INVENTORY_SLOT_CWEAPON_R &
INVENTORY_SLOT_LEFTHAND & INVENTORY_SLOT_LEFTRING & INVENTORY_SLOT_NECK & INVENTORY_SLOT_RIGHTRING & INVENTORY_SLOT_RIGHTHAND;
object oSlot = GetItemInSlot(iSlots, GetEnteringObject());
// Unequip & Re-Equip all items to fix nwnx_haste bug.
AssignCommand(oPC, ActionUnequipItem(oSlot));
AssignCommand(oPC, ActionEquipItem(oSlot, iSlots));
This server crash seems to be new as of .35+ as my use of
NWNX_Creature_RunEquip
had no issues prior to upgrading.In practice, I would run
NWNX_Creature_RunEquip
in a few spots similar to below:Doing the above would result in a server crash (backtrace below). The temp solution to this is to lock the
NWNX_Creature_RunEquip
behind a separate function that includes a DelayCommand:Backtrace: