summaryrefslogtreecommitdiff
path: root/src/char/int_quest.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-15 16:47:08 -0300
committershennetsind <ind@henn.et>2013-05-15 16:47:08 -0300
commit0aee4fd57f2f4135361f4182a08a98cf52ed9d10 (patch)
treed7f43f0a5a63e73e21291f906e33109232ce7830 /src/char/int_quest.c
parent75942979098d34d52adc2537b6f28e02be7d7bae (diff)
downloadhercules-0aee4fd57f2f4135361f4182a08a98cf52ed9d10.tar.gz
hercules-0aee4fd57f2f4135361f4182a08a98cf52ed9d10.tar.bz2
hercules-0aee4fd57f2f4135361f4182a08a98cf52ed9d10.tar.xz
hercules-0aee4fd57f2f4135361f4182a08a98cf52ed9d10.zip
HPM Update
Made SQL and strlib functions HPM-friendly, special thanks to Yommy for bringing the issue up. Added partial map.c support, for the all-handy map[] array, beware that soon the whole map.c renewal design will be commit and when that happens your usage of map.c functions in plugins might require some updates. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/char/int_quest.c')
-rw-r--r--src/char/int_quest.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index 224205412..d771543cc 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/mmo.h"
#include "../common/db.h"
@@ -55,7 +56,7 @@ int mapif_quests_fromsql(int char_id, struct quest questlog[])
//Delete a quest
bool mapif_quest_delete(int char_id, int quest_id)
{
- if ( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `quest_id` = '%d' AND `char_id` = '%d'", quest_db, quest_id, char_id) )
+ if ( SQL_ERROR == SQL->Query(sql_handle, "DELETE FROM `%s` WHERE `quest_id` = '%d' AND `char_id` = '%d'", quest_db, quest_id, char_id) )
{
Sql_ShowDebug(sql_handle);
return false;
@@ -67,7 +68,7 @@ bool mapif_quest_delete(int char_id, int quest_id)
//Add a quest to a questlog
bool mapif_quest_add(int char_id, struct quest qd)
{
- if ( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s`(`quest_id`, `char_id`, `state`, `time`, `count1`, `count2`, `count3`) VALUES ('%d', '%d', '%d','%d', '%d', '%d', '%d')", quest_db, qd.quest_id, char_id, qd.state, qd.time, qd.count[0], qd.count[1], qd.count[2]) )
+ if ( SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s`(`quest_id`, `char_id`, `state`, `time`, `count1`, `count2`, `count3`) VALUES ('%d', '%d', '%d','%d', '%d', '%d', '%d')", quest_db, qd.quest_id, char_id, qd.state, qd.time, qd.count[0], qd.count[1], qd.count[2]) )
{
Sql_ShowDebug(sql_handle);
return false;
@@ -79,7 +80,7 @@ bool mapif_quest_add(int char_id, struct quest qd)
//Update a questlog
bool mapif_quest_update(int char_id, struct quest qd)
{
- if ( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `state`='%d', `count1`='%d', `count2`='%d', `count3`='%d' WHERE `quest_id` = '%d' AND `char_id` = '%d'", quest_db, qd.state, qd.count[0], qd.count[1], qd.count[2], qd.quest_id, char_id) )
+ if ( SQL_ERROR == SQL->Query(sql_handle, "UPDATE `%s` SET `state`='%d', `count1`='%d', `count2`='%d', `count3`='%d' WHERE `quest_id` = '%d' AND `char_id` = '%d'", quest_db, qd.state, qd.count[0], qd.count[1], qd.count[2], qd.quest_id, char_id) )
{
Sql_ShowDebug(sql_handle);
return false;