Oh yes, I forgot to tell that. The rule that you cannot promote to pieces that are not captured and not in the supply array remains applicable. So it should allow 'promotion to self' if a pawn of that type was already captured, but this is probably not the way you tested it. So add p and x to the supply array.
Oh yes, I forgot to tell that. The rule that you cannot promote to pieces that are not captured and not in the supply array remains applicable. So it should allow 'promotion to self' if a pawn of that type was already captured, but this is probably not the way you tested it. So add p and x to the supply array.