mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 23:08:31 +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:
@@ -167,9 +167,11 @@ void PetComponent::OnUse(Entity* originator)
|
||||
std::string buildFile;
|
||||
|
||||
if (cached == buildCache.end()) {
|
||||
auto result = CDClientDatabase::ExecuteQueryWithArgs(
|
||||
"SELECT ValidPiecesLXF, PuzzleModelLot, Timelimit, NumValidPieces, imagCostPerBuild FROM TamingBuildPuzzles WHERE NPCLot = %d;",
|
||||
m_Parent->GetLOT());
|
||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||
"SELECT ValidPiecesLXF, PuzzleModelLot, Timelimit, NumValidPieces, imagCostPerBuild FROM TamingBuildPuzzles WHERE NPCLot = ?;");
|
||||
query.bind(1, (int) m_Parent->GetLOT());
|
||||
|
||||
auto result = query.execQuery();
|
||||
|
||||
if (result.eof())
|
||||
{
|
||||
|
Reference in New Issue
Block a user