/////////////////////////////////////////////////////////////////// Pilot file functions /////////////////////////////////////////////////////////////////// //////////////////////////////////////// deletes a pilot
| 1717 | ///////////////////////////////////////////// |
| 1718 | // deletes a pilot |
| 1719 | bool PltDelete(pilot *Pilot) { |
| 1720 | char filename[_MAX_PATH]; |
| 1721 | char pfilename[_MAX_FNAME]; |
| 1722 | char pname[PILOT_STRING_SIZE]; |
| 1723 | |
| 1724 | Pilot->get_filename(pfilename); |
| 1725 | |
| 1726 | if (pfilename[0] != 0) { |
| 1727 | ddio_MakePath(filename, Base_directory, pfilename, NULL); |
| 1728 | return (ddio_DeleteFile(pfilename) == 1); |
| 1729 | } else { |
| 1730 | Int3(); // this is odd |
| 1731 | |
| 1732 | // it shouldn't get to here, but if for some reason filename didn't exist |
| 1733 | // then create the filename from the player name and delete the file |
| 1734 | Pilot->get_name(pname); |
| 1735 | |
| 1736 | if (pname[0] == 0) |
| 1737 | return false; |
| 1738 | |
| 1739 | PltMakeFNValid(pname); |
| 1740 | |
| 1741 | strcpy(pfilename, pname); |
| 1742 | strcat(pfilename, PLTEXTENSION); |
| 1743 | ddio_MakePath(filename, Base_directory, pfilename, NULL); |
| 1744 | return (ddio_DeleteFile(filename) == 1); |
| 1745 | } |
| 1746 | } |
| 1747 | |
| 1748 | void PltCreateDedicatedServerPilot(pilot *Pilot) { |
| 1749 | Pilot->clean(true); |
no test coverage detected