summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 21:15:57 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 21:15:57 +0000
commita6ba6ca70419e7f6db413c3581aee6e90dc87b0a (patch)
tree8f7f1e068fc2f9bae7e7ff041eb8c3dc83e0e887 /src/map/npc.c
parentb1d22b02963b16c4edcce0cd5d2bc521d97348f9 (diff)
downloadhercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.tar.gz
hercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.tar.bz2
hercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.tar.xz
hercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.zip
- Fixed the server crashing on startup due to bad define
- Fixed the server crashing on a timer-queued disguise / undisguise (no sd check) - re-added the item_group_list for consistency's sake, moved to itemdb.h (after some hacking to remove the ugly map.h dependency) - Removed some overly verbose item group messages & code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10112 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 9cb53327a..f4be64e16 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -90,12 +90,12 @@ int npc_enable_sub( struct block_list *bl, va_list ap )
{
struct map_session_data *sd;
struct npc_data *nd;
- //char *name=(char *)aCallocA(50,sizeof(char)); // fixed [Shinomori]
nullpo_retr(0, bl);
nullpo_retr(0, ap);
nullpo_retr(0, nd=va_arg(ap,struct npc_data *));
- if(bl->type == BL_PC && (sd=(struct map_session_data *)bl)){
+ if(bl->type == BL_PC && (sd=(struct map_session_data *)bl))
+ {
char name[50]; // need 24 + 9 for the "::OnTouch"
if (nd->sc.option&OPTION_INVISIBLE) // 無効化されている
@@ -2136,7 +2136,8 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
//-----------------------------------------
// イベント用ラベルデータのエクスポート
- for (i = 0; i < nd->u.scr.label_list_num; i++){
+ for (i = 0; i < nd->u.scr.label_list_num; i++)
+ {
char *lname = nd->u.scr.label_list[i].name;
int pos = nd->u.scr.label_list[i].pos;
@@ -2149,11 +2150,9 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
exit(1);
} else {
struct event_data *ev;
- unsigned char buf[51];
- // 51 comes from: 24 for npc name + 24 for label + 2 for a "::" and 1 for EOS
+ unsigned char buf[50+1]; // 24 for npc name + 24 for label + 2 for a "::" and 1 for EOS
sprintf(buf,"%s::%s",nd->exname,lname);
- // remember the label is max 50 chars + eos; see the strdb_init below
// generate the data and insert it
ev=(struct event_data *)aMalloc(sizeof(struct event_data));
ev->nd=nd;