* Fixed script commands attachrid and detachrid not updating the attached character's information about currently running script, causing errors with dialog-based scripts or preventing characters from walking (bugreport:4571).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14501 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
68168bbf6d
commit
db5357a6e0
@ -1,5 +1,7 @@
|
||||
Date Added
|
||||
|
||||
2010/11/25
|
||||
* Fixed script commands attachrid and detachrid not updating the attached character's information about currently running script, causing errors with dialog-based scripts or preventing characters from walking (bugreport:4571). [Ai4rei]
|
||||
2010/11/24
|
||||
* Fixed party booking search not interpreting level 0 as 'all levels' and using level as upper rather than lower bound (bugreport:4537, since r14412). [Ai4rei]
|
||||
* Display a message showing the user where to change MAX_ITEMDELAYS when they have too many entries in the item_delays db. Follow-up to r14455. [Paradox924X]
|
||||
|
@ -9087,14 +9087,40 @@ BUILDIN_FUNC(warpwaitingpc)
|
||||
// ...
|
||||
//
|
||||
|
||||
static void script_detach_rid(struct script_state* st)
|
||||
{
|
||||
struct map_session_data* sd;
|
||||
|
||||
if(st->rid)
|
||||
{
|
||||
if((sd = script_rid2sd(st))!=NULL)
|
||||
{
|
||||
if(sd->npc_id!=st->oid)
|
||||
{
|
||||
ShowDebug("script_detach_rid: sd->npc_id (%d) != st->oid (%d), please report this!\n", sd->npc_id, st->oid);
|
||||
script_reportsrc(st);
|
||||
}
|
||||
|
||||
sd->npc_id = 0;
|
||||
sd->st = NULL;
|
||||
}
|
||||
st->rid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* RID‚̃Aƒ^ƒbƒ`
|
||||
*------------------------------------------*/
|
||||
BUILDIN_FUNC(attachrid)
|
||||
{
|
||||
int rid = script_getnum(st,2);
|
||||
|
||||
if (map_id2sd(rid)) {
|
||||
struct map_session_data* sd;
|
||||
|
||||
if ((sd = map_id2sd(rid))!=NULL) {
|
||||
script_detach_rid(st);
|
||||
|
||||
sd->st = st;
|
||||
sd->npc_id = st->oid;
|
||||
st->rid = rid;
|
||||
script_pushint(st,1);
|
||||
} else
|
||||
@ -9106,7 +9132,7 @@ BUILDIN_FUNC(attachrid)
|
||||
*------------------------------------------*/
|
||||
BUILDIN_FUNC(detachrid)
|
||||
{
|
||||
st->rid=0;
|
||||
script_detach_rid(st);
|
||||
return 0;
|
||||
}
|
||||
/*==========================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user