* Fixed a bug with InitTimer/StopTimer
git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1358 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
258c0293ee
commit
05e31aee3c
@ -2,6 +2,7 @@
|
|||||||
Date Added
|
Date Added
|
||||||
|
|
||||||
03/31
|
03/31
|
||||||
|
* Fixed a bug with InitTimer/StopTimer, thanks to ilpalazzo-sama
|
||||||
* Set 'undead_detect_type' to 0 by default, thanks to Dino9021
|
* Set 'undead_detect_type' to 0 by default, thanks to Dino9021
|
||||||
* Fixed Enchant Poison / Deadly Poison having too high poisoning chance
|
* Fixed Enchant Poison / Deadly Poison having too high poisoning chance
|
||||||
* Reverted the pc_remove_map() change temporarily
|
* Reverted the pc_remove_map() change temporarily
|
||||||
|
@ -499,33 +499,33 @@ int npc_cleareventtimer(struct npc_data *nd)
|
|||||||
|
|
||||||
int npc_do_ontimer_sub(void *key,void *data,va_list ap)
|
int npc_do_ontimer_sub(void *key,void *data,va_list ap)
|
||||||
{
|
{
|
||||||
char *p=(char *)key;
|
char *p = (char *)key;
|
||||||
struct event_data *ev=(struct event_data *)data;
|
struct event_data *ev = (struct event_data *)data;
|
||||||
int *c=va_arg(ap,int *);
|
int *c = va_arg(ap,int *);
|
||||||
// struct map_session_data *sd=va_arg(ap,struct map_session_data *);
|
// struct map_session_data *sd=va_arg(ap,struct map_session_data *);
|
||||||
int option=va_arg(ap,int);
|
int option = va_arg(ap,int);
|
||||||
int tick=0;
|
int tick = 0;
|
||||||
char temp[10];
|
char temp[10];
|
||||||
char event[50];
|
char event[50];
|
||||||
|
|
||||||
if(ev->nd->bl.id==(int)*c && (p=strchr(p,':')) && p && strnicmp("::OnTimer",p,8)==0 ){
|
if(ev->nd->bl.id == (int)*c && (p = strchr(p,':')) && strnicmp("::OnTimer",p,8) == 0){
|
||||||
sscanf(&p[9],"%s",temp);
|
sscanf(&p[9], "%s", temp);
|
||||||
tick=atoi(temp);
|
tick = atoi(temp);
|
||||||
|
|
||||||
strcpy( event, ev->nd->name);
|
strcpy(event, ev->nd->name);
|
||||||
strcat( event, p);
|
strcat(event, p);
|
||||||
|
|
||||||
if (option!=0) {
|
if (option!=0) {
|
||||||
npc_addeventtimer(ev->nd,tick,event);
|
npc_addeventtimer(ev->nd, tick, event);
|
||||||
} else {
|
} else {
|
||||||
npc_deleventtimer(ev->nd,event);
|
npc_deleventtimer(ev->nd, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int npc_do_ontimer(int npc_id, struct map_session_data *sd, int option)
|
int npc_do_ontimer(int npc_id, int option)
|
||||||
{
|
{
|
||||||
strdb_foreach(ev_db,npc_do_ontimer_sub,&npc_id,sd,option);
|
strdb_foreach(ev_db, npc_do_ontimer_sub, &npc_id, option);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
|
@ -42,7 +42,7 @@ void npc_delsrcfile(char *);
|
|||||||
int do_final_npc(void);
|
int do_final_npc(void);
|
||||||
int do_init_npc(void);
|
int do_init_npc(void);
|
||||||
int npc_event_do_oninit(void);
|
int npc_event_do_oninit(void);
|
||||||
int npc_do_ontimer(int,struct map_session_data *,int);
|
int npc_do_ontimer(int,int);
|
||||||
|
|
||||||
int npc_event_doall(const char *name);
|
int npc_event_doall(const char *name);
|
||||||
int npc_event_do(const char *name);
|
int npc_event_do(const char *name);
|
||||||
|
@ -5524,9 +5524,9 @@ int buildin_cmdothernpc(struct script_state *st) // Added by RoVeRT
|
|||||||
int buildin_inittimer(struct script_state *st) // Added by RoVeRT
|
int buildin_inittimer(struct script_state *st) // Added by RoVeRT
|
||||||
{
|
{
|
||||||
// struct npc_data *nd=(struct npc_data*)map_id2bl(st->oid);
|
// struct npc_data *nd=(struct npc_data*)map_id2bl(st->oid);
|
||||||
|
|
||||||
// nd->lastaction=nd->timer=gettick();
|
// nd->lastaction=nd->timer=gettick();
|
||||||
npc_do_ontimer(st->oid, map_id2sd(st->rid), 1);
|
|
||||||
|
npc_do_ontimer(st->oid, 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -5534,9 +5534,9 @@ int buildin_inittimer(struct script_state *st) // Added by RoVeRT
|
|||||||
int buildin_stoptimer(struct script_state *st) // Added by RoVeRT
|
int buildin_stoptimer(struct script_state *st) // Added by RoVeRT
|
||||||
{
|
{
|
||||||
// struct npc_data *nd=(struct npc_data*)map_id2bl(st->oid);
|
// struct npc_data *nd=(struct npc_data*)map_id2bl(st->oid);
|
||||||
|
|
||||||
// nd->lastaction=nd->timer=-1;
|
// nd->lastaction=nd->timer=-1;
|
||||||
npc_do_ontimer(st->oid, map_id2sd(st->rid), 0);
|
|
||||||
|
npc_do_ontimer(st->oid, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user