summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-09 13:03:34 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-09 13:03:34 +0000
commit78d148b352731f8af910251e3700d3eaa9d59cf7 (patch)
treeb5a744f0f90649b1e9f8fd4f782f9e2ae1b026fe /src/map/npc.c
parentcc716ca00420c23bdb02831f8fc205d4588e1f75 (diff)
downloadhercules-78d148b352731f8af910251e3700d3eaa9d59cf7.tar.gz
hercules-78d148b352731f8af910251e3700d3eaa9d59cf7.tar.bz2
hercules-78d148b352731f8af910251e3700d3eaa9d59cf7.tar.xz
hercules-78d148b352731f8af910251e3700d3eaa9d59cf7.zip
* Changed db key from 'unsigned char*' to 'const char*'.
* Defined out the dump function in util.h/c. Notes: saw some suspicious code in npc.c so kept the 'const char*' propagation to a minimum for now git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10193 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 941eec4c8..bf10e6230 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1,12 +1,6 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-
#include "../common/cbasetypes.h"
#include "../common/timer.h"
#include "../common/nullpo.h"
@@ -17,7 +11,6 @@
#include "../common/db.h"
#include "map.h"
#include "log.h"
-#include "npc.h"
#include "clif.h"
#include "intif.h"
#include "pc.h"
@@ -29,11 +22,18 @@
#include "battle.h"
#include "skill.h"
#include "unit.h"
+#include "npc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <time.h>
+
struct npc_src_list {
struct npc_src_list * next;
-// struct npc_src_list * prev; //[Shinomori]
char name[4];
};
@@ -67,7 +67,7 @@ static struct
{ //Holds pointers to the commonly executed scripts for speedup. [Skotlex]
struct npc_data *nd;
struct event_data *event[UCHAR_MAX];
- unsigned char *event_name[UCHAR_MAX];
+ const char *event_name[UCHAR_MAX];
unsigned char event_count;
} script_event[NPCE_MAX];
@@ -320,7 +320,7 @@ int npc_event_sub(struct map_session_data *, struct event_data *, const unsigned
*/
int npc_event_doall_sub(DBKey key,void *data,va_list ap)
{
- unsigned char*p = key.str;
+ const char*p = key.str;
struct event_data *ev;
int *c;
int rid;
@@ -362,7 +362,7 @@ int npc_event_doall_id(const unsigned char *name, int rid)
int npc_event_do_sub(DBKey key,void *data,va_list ap)
{
- unsigned char *p = key.str;
+ const char *p = key.str;
struct event_data *ev;
int *c;
const unsigned char *name;
@@ -511,7 +511,7 @@ int npc_cleareventtimer(struct npc_data *nd)
int npc_do_ontimer_sub(DBKey key,void *data,va_list ap)
{
- unsigned char *p = key.str;
+ const char *p = key.str;
struct event_data *ev = (struct event_data *)data;
int *c = va_arg(ap,int *);
// struct map_session_data *sd=va_arg(ap,struct map_session_data *);
@@ -2900,10 +2900,10 @@ int npc_script_event(TBL_PC* sd, int type) {
static int npc_read_event_script_sub(DBKey key,void *data,va_list ap)
{
- unsigned char *p = key.str;
+ const char *p = key.str;
unsigned char *name = va_arg(ap,unsigned char *);
struct event_data **event_buf = va_arg(ap,struct event_data**);
- unsigned char **event_name = va_arg(ap,unsigned char **);
+ const char **event_name = va_arg(ap,const char **);
unsigned char *count = va_arg(ap,char *);;
if (*count >= UCHAR_MAX) return 0;