mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 02:04:04 +00:00
Comply with Xiphoseer required changes.
Remove the CDClientDatabase::ExecuteQueryWithArgs() function and replace it with CDClientDatabase::CreatePreppedStmt(). This prevents a developer from accidently using %s, or incorrectly passing std::string, and causing a silent error.
This commit is contained in:
@@ -16,9 +16,11 @@
|
||||
std::map<uint32_t, Precondition*> Preconditions::cache = {};
|
||||
|
||||
Precondition::Precondition(const uint32_t condition) {
|
||||
auto result = CDClientDatabase::ExecuteQueryWithArgs(
|
||||
"SELECT type, targetLOT, targetCount FROM Preconditions WHERE id = %u;",
|
||||
condition);
|
||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||
"SELECT type, targetLOT, targetCount FROM Preconditions WHERE id = ?;");
|
||||
query.bind(1, (int) condition);
|
||||
|
||||
auto result = query.execQuery();
|
||||
|
||||
if (result.eof())
|
||||
{
|
||||
|
Reference in New Issue
Block a user