// Maximum hit points of a player
#define PLAYER_MAX_HP 20
+// Number of different files to try to save a player to if the first fails
+// (because of a case-insensitive filesystem)
+// TODO: Use case-insensitive player names instead of this hack.
+#define PLAYER_FILE_ALTERNATE_TRIES 1000
+
/*
* GUI related things
*/
RemotePlayer testplayer(m_gamedef);
std::string path = players_path + playername;
- for (u32 i = 0; i < 1000; i++) {
+ for (u32 i = 0; i < PLAYER_FILE_ALTERNATE_TRIES; i++) {
// Open file and deserialize
std::ifstream is(path.c_str(), std::ios_base::binary);
if (!is.good()) {
savedir += DIR_DELIM;
std::string path = savedir + m_name;
- for (u32 i = 0; i < 1000; i++) {
+ for (u32 i = 0; i < PLAYER_FILE_ALTERNATE_TRIES; i++) {
if (!fs::PathExists(path)) {
// Open file and serialize
std::ostringstream ss(std::ios_base::binary);