summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-21 15:59:38 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-21 15:59:38 +0000
commita102b2dffb9365116701f99c0dcc486a74cbc073 (patch)
treef48c32f5ee7c056fa4eb9675b33c69b574cfee1d /src/map/npc.c
parent6a71c68fd365d0b7e91fe89a2d02296ef465a720 (diff)
downloadhercules-a102b2dffb9365116701f99c0dcc486a74cbc073.tar.gz
hercules-a102b2dffb9365116701f99c0dcc486a74cbc073.tar.bz2
hercules-a102b2dffb9365116701f99c0dcc486a74cbc073.tar.xz
hercules-a102b2dffb9365116701f99c0dcc486a74cbc073.zip
- Some fine-tuning of the warp portal code which prevents it from messing up other skills if you "precast" it.
- Fixed the weapon refine code using sd->skillid instead of sd->menuskill_id - Fixed some npc_event error reports (three error where displaying at the exact same msg, making it impossible to tell which one of the three actually happened) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5356 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 7bdba2a61..4a7562b18 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -208,7 +208,7 @@ int npc_timer_event(const unsigned char *eventname) // Added by RoVeRT
// int xs,ys;
if((ev==NULL || (nd=ev->nd)==NULL)){
- ShowWarning("npc_event: event not found [%s]\n",eventname);
+ ShowWarning("npc_timer_event: event not found [%s]\n",eventname);
return 0;
}
@@ -435,11 +435,18 @@ int npc_event_do_oninit(void)
int npc_addeventtimer(struct npc_data *nd,int tick,const char *name)
{
int i;
+ unsigned char *evname;
+
for(i=0;i<MAX_EVENTTIMER;i++)
if( nd->eventtimer[i]==-1 )
break;
if(i<MAX_EVENTTIMER){
- unsigned char *evname=(unsigned char *) aCallocA(NAME_LENGTH, sizeof(char));
+ if (!strdb_get(ev_db,name)) {
+ if (battle_config.error_log)
+ ShowError("npc_addeventimer: Event %s does not exists.\n", name);
+ return 1; //Event does not exists!
+ }
+ evname =(unsigned char *) aCallocA(NAME_LENGTH, sizeof(char));
if(evname==NULL){
ShowFatalError("npc_addeventtimer: out of memory !\n");exit(1);
}
@@ -802,7 +809,7 @@ int npc_event (struct map_session_data *sd, const unsigned char *eventname, int
ev = strdb_get(ev_db, mobevent);
if (ev == NULL || (nd = ev->nd) == NULL) {
if (strnicmp(eventname, "GM_MONSTER",10) != 0)
- ShowError("npc_event: event not found [%s]\n", mobevent);
+ ShowError("npc_event: (mob_kill) event not found [%s]\n", mobevent);
return 0;
}
} else {