Bug: Prototype check in mset command can crash the game
Danger: High - Will crash if a PLR flag has the same value as an ACT flag and is edited on a PC.
Found by: Qidexan
Fixed by: Qidexan/Samson
---
build.c, do_mset
In the "flags" section, locate:
if( IS_SET( victim->act, ACT_PROTOTYPE ) )
protoflag = TRUE;
Change to:
if( IS_NPC( victim ) && IS_SET( victim->act, ACT_PROTOTYPE ) )
protoflag = TRUE;
Locate:
if( IS_SET( victim->act, ACT_PROTOTYPE ) || ( value == ACT_PROTOTYPE && protoflag ) )
victim->pIndexData->act = victim->act;
Change to:
if( IS_NPC( victim ) && ( IS_SET( victim->act, ACT_PROTOTYPE ) || ( 1 << value == ACT_PROTOTYPE && protoflag ) ) )
victim->pIndexData->act = victim->act;
The prototype checking in this function is not verifying that the victim is an NPC. While the first check would remain relatively harmless, the second one will result in a crash if the PC being edited happens to have the PLR flag with the same numerical value set.