aboutsummaryrefslogtreecommitdiffstats
path: root/src/Quest.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-15 09:07:06 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-15 09:07:06 -0400
commit5c2179bc9afa809fa3b915bea0d75f62f90f0644 (patch)
treebd7926369bfc540ebf925d070e1102576292d9bf /src/Quest.cpp
parent5adabb82443b9b10b25cdd8b4db3cfe890e36fa1 (diff)
quest fixes
Diffstat (limited to 'src/Quest.cpp')
-rw-r--r--src/Quest.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/Quest.cpp b/src/Quest.cpp
index 5d19795..8aea006 100644
--- a/src/Quest.cpp
+++ b/src/Quest.cpp
@@ -1,17 +1,22 @@
#include <common.h>
-//#include <Quest.h>
-//#include <entities.h>
+
+#define TITLE Quest(
+#define DESC ,
+#define REWARD ,(struct item_t){
+#define x ,
+#define END }),
const Quest QuestList[TOTAL_QUESTS]={
- Quest("Test","A test quest",(struct item_t){1,TEST_ITEM})
+// Quest("Test","A test quest",(struct item_t){1,TEST_ITEM}),
+
+// Get quest list
+#include "../config/quest_list.txt"
+
};
Quest::Quest(const char *t,const char *d,struct item_t r){
- size_t len;
- title=(char *)malloc((len=strlen(t)));
- strncpy(title,t,len);
- desc=(char *)malloc((len=strlen(d)));
- strncpy(desc,d,len);
+ strcpy((title=(char *)malloc(strlen(t))),t);
+ strcpy((desc =(char *)malloc(strlen(d))),d);
memcpy(&reward,&r,sizeof(struct item_t));
}
@@ -39,6 +44,9 @@ int QuestHandler::assign(const char *t){
#endif // DEBUG
return current.size();
}
+#ifdef DEBUG
+ DEBUG_printf("Finding quest: %s != %s\n",t,QuestList[i].title);
+#endif // DEBUG
}
#ifdef DEBUG
DEBUG_printf("Quest %s does not exist.\n",t);