From be082fe6ffd0dd4a4f033c9ecb36549a70df7b98 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 24 May 2018 18:14:06 -0300 Subject: Check if Alige previous quest was removed --- npc/002-1/alige.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'npc/002-1') diff --git a/npc/002-1/alige.txt b/npc/002-1/alige.txt index 862003290..0abdc1522 100644 --- a/npc/002-1/alige.txt +++ b/npc/002-1/alige.txt @@ -12,6 +12,7 @@ // food, water, and money for a hat. 002-1,45,26,0 script Alige NPC_ALIGE,{ + .@q=getq(ShipQuests_Alige); mesn; mesq lg("Hey, dude! The guards are after me. I need your help, and I can reward you."); next; @@ -39,6 +40,17 @@ L_GoGo: OnInit: .sex = G_MALE; .distance = 2; + + // Preventive check against faulty update. Must be removed afterwards. + // UPDATE `quest` SET `count1` = '0' WHERE `quest`.`quest_id` = 2; + .@nb = query_sql("select `char_id` from `quest` WHERE (`count1`>=1 and `quest_id`=2) LIMIT 2", .@name$); + if (getarraysize(.@name$) > 0) { + debugmes "FATAL ERROR: Quest log not updated."; + debugmes "disabling Alige to prevent weirder bugs."; + debugmes "UPDATE `quest` SET `count1` = '0' WHERE `quest`.`quest_id` = 2"; + disablenpc .name$; + } + end; -- cgit v1.2.3-60-g2f50