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()) {
|
if (balance.empty()) {
|
||||||
addUserToDatabase(userid);
|
addUserToDatabase(userid);
|
||||||
balance = "0";
|
execSQL("SELECT CASH FROM MONEY WHERE UID=" + userid.str(),
|
||||||
} else {
|
&balance); // We are rerunning it cus if the default starting cash
|
||||||
std::uint8_t begining = balance.find(':') + 1;
|
// changes I might forget to change it here
|
||||||
balance = balance.substr(begining, balance.find(';') - begining);
|
|
||||||
}
|
}
|
||||||
return balance;
|
std::uint8_t begining = balance.find(':') + 1;
|
||||||
|
|
||||||
|
return balance.substr(begining, balance.find(';') - begining);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void addUserToDatabase(const dpp::snowflake userid) {
|
inline void addUserToDatabase(const dpp::snowflake userid) {
|
||||||
|
Reference in New Issue
Block a user