This is my first time back since the loss of Smaugfuss.org, which I just found out about and am sorry to see the loss of. But I on to bugfixing?!
This exploit, found by Morgon of SWGI and fixed by me, allows a mortal to control an immortal if the immortal switches into a mob that is charmed. I fixed this one with a simple ifcheck addition and it works to my liking. As always, if you find a better solution, feel free to share.
for( och = ch->in_room->first_person; och; och = och_next )
och_next = och->next_in_room;
if( IS_AFFECTED( och, AFF_CHARM ) && och->master == ch && ( fAll || och == victim ) )
found = TRUE;
act( AT_ACTION, "$n orders you to '$t'.", ch, argument, och, TO_VICT );
interpret( och, argument );
Fix the ifcheck to reflect the change:
if( IS_AFFECTED( och, AFF_CHARM ) && och->master == ch && ( fAll || och == victim ) && !IS_IMMORTAL(och))
With this check, if the mortal tries to 'order' the mob or 'order' all and there is an immortal switched into the mob, it will return 'You have no followers here.' to the player. This fixes the problem and I see no loophole around it. This exploit allowed me to promote my mortal to an immortal by ordering a mob to makeimm the mortal. There is low chance of the situation happening, but if it does it could be dangerous.