updated Save() and Load() paths

This commit is contained in:
EntireTwix 2021-07-14 23:02:34 -07:00
parent 30c4344055
commit ab1e154ab8

View file

@ -289,7 +289,7 @@ const char *Bank::Save()
{ {
#endif #endif
save_start: save_start:
std::ofstream users_save("users.dat", std::ios::out | std::ios::binary); std::ofstream users_save(users_location, std::ios::out | std::ios::binary);
if (!users_save) if (!users_save)
{ {
throw std::invalid_argument("Cannot access saving file\n"); throw std::invalid_argument("Cannot access saving file\n");
@ -337,7 +337,7 @@ const char *Bank::Save()
//NOT THREAD SAFE, BY NO MEANS SHOULD THIS BE CALLED WHILE RECEIEVING REQUESTS //NOT THREAD SAFE, BY NO MEANS SHOULD THIS BE CALLED WHILE RECEIEVING REQUESTS
void Bank::Load() void Bank::Load()
{ {
std::ifstream users_save("users.dat", std::ios::out | std::ios::binary); std::ifstream users_save(users_location, std::ios::out | std::ios::binary);
if (!users_save) if (!users_save)
{ {
throw std::invalid_argument("Cannot access saving file\n"); throw std::invalid_argument("Cannot access saving file\n");