Resets the ship permissions for a given player pass false for set_default if you don't want the default ship allowed
| 3663 | // Resets the ship permissions for a given player |
| 3664 | // pass false for set_default if you don't want the default ship allowed |
| 3665 | bool PlayerResetShipPermissions(int pnum, bool set_default) { |
| 3666 | if (pnum < -1 || pnum >= MAX_PLAYERS) |
| 3667 | return false; |
| 3668 | |
| 3669 | int perm; |
| 3670 | |
| 3671 | mprintf(0, "Reseting ship permissions\n"); |
| 3672 | |
| 3673 | if (set_default) |
| 3674 | perm = Default_ship_permission; |
| 3675 | else |
| 3676 | perm = 0; |
| 3677 | |
| 3678 | if (pnum == -1) { |
| 3679 | for (int i = 0; i < MAX_PLAYERS; i++) { |
| 3680 | Players[i].ship_permissions = perm; |
| 3681 | } |
| 3682 | } else { |
| 3683 | Players[pnum].ship_permissions = perm; |
| 3684 | } |
| 3685 | |
| 3686 | return true; |
| 3687 | } |
| 3688 | |
| 3689 | // Returns true if the given ship is allowed to be chosen for a pnum |
| 3690 | bool PlayerIsShipAllowed(int pnum, char *ship_name) { |
no outgoing calls
no test coverage detected