mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +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:
@@ -18,10 +18,12 @@
|
||||
#include "PacketUtils.h"
|
||||
|
||||
RocketLaunchpadControlComponent::RocketLaunchpadControlComponent(Entity* parent, int rocketId) : Component(parent) {
|
||||
auto result = CDClientDatabase::ExecuteQueryWithArgs(
|
||||
"SELECT targetZone, defaultZoneID, targetScene, altLandingPrecondition, altLandingSpawnPointName FROM RocketLaunchpadControlComponent WHERE id = %d;",
|
||||
rocketId);
|
||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||
"SELECT targetZone, defaultZoneID, targetScene, altLandingPrecondition, altLandingSpawnPointName FROM RocketLaunchpadControlComponent WHERE id = ?;");
|
||||
query.bind(1, rocketId);
|
||||
|
||||
auto result = query.execQuery();
|
||||
|
||||
if (!result.eof() && !result.fieldIsNull(0))
|
||||
{
|
||||
m_TargetZone = result.getIntField(0);
|
||||
|
Reference in New Issue
Block a user