Possible bug regarding default value of cash
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user