diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-05-23 21:23:36 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-05-23 21:23:36 +0000 |
commit | f6bcd12cd633717e9e503bb453c85955e29cd519 (patch) | |
tree | 49225d619843accadf26532263f615392da5b8a2 /src/map/npc.c | |
parent | 9b9305b6b1a1a004c2ef909404daa705e956a5de (diff) | |
download | hercules-f6bcd12cd633717e9e503bb453c85955e29cd519.tar.gz hercules-f6bcd12cd633717e9e503bb453c85955e29cd519.tar.bz2 hercules-f6bcd12cd633717e9e503bb453c85955e29cd519.tar.xz hercules-f6bcd12cd633717e9e503bb453c85955e29cd519.zip |
- Added new flag to skill_castnodex.txt, to allow per-skill tweaking of cast time and delay reducibility by item scripts (cards and such)
- Fixed Martyr's Reckoning never triggering for gms with all skills
- Added MO_TRIPLEATTACK and RG_SNATCHER to @skillall's skill filter
- Made gm_skill_unconditional bypass skill blocking (guild timer, etc)
- Reverted the weird delay_dependon_agi thing (r8923, r9055, r9059)
- Changed a few memsets to strncpy (reading past buffer is a bad idea)
- Sped up some memset operations (multiples of 4 are faster)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10613 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index f037bea2d..61a8ef093 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -464,7 +464,7 @@ int npc_addeventtimer(struct npc_data *nd,int tick,const char *name) if(evname==NULL){ ShowFatalError("npc_addeventtimer: out of memory !\n");exit(1); } - memcpy(evname,name,NAME_LENGTH-1); + strncpy(evname,name,NAME_LENGTH); evname[NAME_LENGTH-1] = '\0'; nd->eventtimer[i]=add_timer(gettick()+tick, npc_event_timer,nd->bl.id,(int)evname); @@ -1660,8 +1660,8 @@ int npc_parse_warp (char *w1,char *w2,char *w3,char *w4) nd->bl.m = m; nd->bl.x = x; nd->bl.y = y; - memcpy(nd->name, w3, NAME_LENGTH-1); - memcpy(nd->exname, w3, NAME_LENGTH-1); + strncpy(nd->name, w3, NAME_LENGTH); + strncpy(nd->exname, w3, NAME_LENGTH); if (!battle_config.warp_point_debug) nd->class_ = WARP_CLASS; @@ -1761,7 +1761,7 @@ static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4) nd->bl.x = x; nd->bl.y = y; nd->bl.id = npc_get_new_npc_id(); - memcpy(nd->name, w3, NAME_LENGTH-1); + memcpy(nd->name, w3, NAME_LENGTH); nd->name[NAME_LENGTH-1] = '\0'; nd->class_ = m==-1?-1:atoi(w4); nd->speed = 200; @@ -2036,11 +2036,11 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line } if (p) { *p = 0; - memcpy(nd->name, w3, NAME_LENGTH-1); - memcpy(nd->exname, p+2, NAME_LENGTH-1); + memcpy(nd->name, w3, NAME_LENGTH); + memcpy(nd->exname, p+2, NAME_LENGTH); } else { - memcpy(nd->name, w3, NAME_LENGTH-1); - memcpy(nd->exname, w3, NAME_LENGTH-1); + memcpy(nd->name, w3, NAME_LENGTH); + memcpy(nd->exname, w3, NAME_LENGTH); } if((dnd = npc_name2id(nd->exname))){ |