Possible bug regarding default value of cash

This commit is contained in:
2025-07-19 02:28:42 +03:00
parent d2c215df36
commit 3a4bf72bcc

View File

@@ -54,12 +54,13 @@ inline std::string getUserBalance(const dpp::snowflake userid) {
if (balance.empty()) {
addUserToDatabase(userid);
balance = "0";
} else {
std::uint8_t begining = balance.find(':') + 1;
balance = balance.substr(begining, balance.find(';') - begining);
execSQL("SELECT CASH FROM MONEY WHERE UID=" + userid.str(),
&balance); // We are rerunning it cus if the default starting cash
// changes I might forget to change it here
}
return balance;
std::uint8_t begining = balance.find(':') + 1;
return balance.substr(begining, balance.find(';') - begining);
}
inline void addUserToDatabase(const dpp::snowflake userid) {