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

NWNX_Player_PossessCreature: PC irreversibly corrupted if Effect Removed #1685

Open Christian-Vassallo opened 1 year ago

Christian-Vassallo commented 1 year ago

It seems a critical bug: once possessed the creature, in case all the effects are removed, the player is locked inside the PNG. The player is able to see the list of all the PNG (same faction) as in the group, the PNG can level up (if it is done, there is a segmentation fault of the server) and if logout the .bic file is corrupted and overrided with the PNG schedule. This is more or less the previous behavior of dominate a PNG but in NWNX 1.69.

How to test: 1) dominate a creature 2) run a script in which all the effects are removed eassssy example to put in PCChat event effect e = GetFirstEffect(oPC); while(GetIsEffectValid(e)) { RemoveEffect(oPC, e); e = GetNextEffect(oPC); }

The result should be something like that https://i.postimg.cc/L5yHyPSz/image.png

Thanks

Christian-Vassallo commented 1 year ago

EDIT:

A solution from scripting side can be done by exploiting the NWNX_ON_EFFECT_REMOVED_BEFORE. Indeed, it is possible to check if the creature is possessed and then UnpossessFamiliar.