getActivePlayerIndex returns zero if the player is not active, this can be misleading because 0 is a valid index
getActivePlayerIndex returns zero for a player which is present on the 0 index in array and also if the player is not active which is not an ideal behaviour as return value doesn't clarify if the state of player is either active or not.
here's a test case to show what getActivePlayerIndex returns in both conditions
it's clearly visible return value is same in both the cases
Foundry
some modifications in getActivePlayerIndex can fix this , for example. rather than returning zero in case of an inactive player , it can throw a custom error InActivePlayer or return an invalid index
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.