revised npc_event_dequeue; added a check to party share & devel update [Shinomori]
git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1175 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
a8d577e428
commit
98401cf0df
@ -135,17 +135,35 @@ int npc_event_dequeue(struct map_session_data *sd)
|
||||
|
||||
sd->npc_id=0;
|
||||
if (sd->eventqueue[0][0]) { // キューのイベント処理
|
||||
char *name=(char *)aCallocA(50,sizeof(char));
|
||||
int i;
|
||||
size_t ev;
|
||||
|
||||
// find an empty place in eventtimer list
|
||||
for(ev=0;ev<MAX_EVENTTIMER;ev++)
|
||||
if( sd->eventtimer[ev]==-1 )
|
||||
break;
|
||||
if(ev<MAX_EVENTTIMER)
|
||||
{ // generate and insert the timer
|
||||
int i;
|
||||
// copy the first event name
|
||||
char *name=(char *)aMalloc(50*sizeof(char));
|
||||
memcpy(name,sd->eventqueue[0],50);
|
||||
for(i=MAX_EVENTQUEUE-2;i>=0;i--)
|
||||
memcpy(sd->eventqueue[i],sd->eventqueue[i+1],50);
|
||||
add_timer(gettick()+100,npc_event_timer,sd->bl.id,(int)name);
|
||||
// shift queued events down by one
|
||||
for(i=1;i<MAX_EVENTQUEUE;i++)
|
||||
memcpy(sd->eventqueue[i-1],sd->eventqueue[i],50);
|
||||
// clear the last event
|
||||
sd->eventqueue[MAX_EVENTQUEUE-1][0]=0;
|
||||
// add the timer
|
||||
sd->eventtimer[ev]=add_timer(gettick()+100,pc_eventtimer,sd->bl.id,(int)name);//!!todo!!
|
||||
|
||||
}else
|
||||
ShowMessage("npc_event_dequeue: event timer is full !\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int npc_delete(struct npc_data *nd)
|
||||
{
|
||||
nullpo_retr(1, nd);
|
||||
|
@ -587,12 +587,13 @@ int party_exp_share(struct party *p,int map,int base_exp,int job_exp,int zeny)
|
||||
nullpo_retr(0, p);
|
||||
|
||||
for(i=c=0;i<MAX_PARTY;i++)
|
||||
if((sd=p->member[i].sd)!=NULL && sd->bl.m==map)
|
||||
if((sd=p->member[i].sd)!=NULL && p->member[i].online && sd->bl.m==map && session[sd->fd] != NULL)
|
||||
c++;
|
||||
|
||||
if(c==0)
|
||||
return 0;
|
||||
for(i=0;i<MAX_PARTY;i++)
|
||||
if((sd=p->member[i].sd)!=NULL && sd->bl.m==map && session[sd->fd] != NULL) {
|
||||
if((sd=p->member[i].sd)!=NULL && p->member[i].online && sd->bl.m==map && session[sd->fd] != NULL) {
|
||||
if (/* pc_issit(sd) || */ sd->chatID || (sd->idletime < (tick_ - 120)))
|
||||
continue;
|
||||
#ifdef TWILIGHT
|
||||
|
@ -199,6 +199,8 @@ int pc_delinvincibletimer(struct map_session_data *sd);
|
||||
int pc_addspiritball(struct map_session_data *sd,int,int);
|
||||
int pc_delspiritball(struct map_session_data *sd,int,int);
|
||||
|
||||
int pc_eventtimer(int tid,unsigned long tick,int id,int data); // for npc_dequeue
|
||||
|
||||
int do_init_pc(void);
|
||||
|
||||
enum {ADDITEM_EXIST,ADDITEM_NEW,ADDITEM_OVERAMOUNT};
|
||||
|
Loading…
x
Reference in New Issue
Block a user