gekigengar Posted July 7, 2017 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 174 Reputation: 2 Joined: 08/30/13 Last Seen: October 1, 2017 Share Posted July 7, 2017 (edited) Hello, I have a script by AnnieRuru from my 2013 - 2014 server. It used to work perfectly, until I decided to update my rAthena to the latest (From 2013/2014) BUILDIN_FUNC(setdir) { TBL_PC *sd; if ( script_hasdata(st,4) ) { if ( data_isstring( script_getdata(st,4) ) ) sd = map_nick2sd( script_getstr(st,4),false ); else sd = map_id2sd( script_getnum(st,4) ); } else sd = script_rid2sd(st); if ( sd ) { int value = 0; if ( script_hasdata(st,3) ) { value = script_getnum(st,3); if ( value < 0 || value > 2 ) value = 0; } pc_setdir( sd, script_getnum(st,2), value ); clif_changed_dir( &sd->bl, AREA ); } return SCRIPT_CMD_SUCCESS; } BUILDIN_FUNC(checkdir) { TBL_PC *sd; if ( script_hasdata(st,3) ) { if ( data_isstring( script_getdata(st,3) ) ) sd = map_nick2sd( script_getstr(st,3),false ); else sd = map_id2sd( script_getnum(st,3) ); } else sd = script_rid2sd(st); if ( sd ) { int value = 0; if ( script_hasdata(st,2) ) value = script_getnum(st,2); script_pushint( st, value > 0 ? sd->head_dir : sd->ud.dir ); } return SCRIPT_CMD_SUCCESS; } First it gave me an error during compilation for map_nick2sd( script_getstr(st,4)); Looking into the changes, I noticed there is now a feature for incomplete map names, so I put in ", false" for the 2nd parameter. The compiler no longer gave me an error, and mapserver runs well, until made an NPC use the script to set a character's direction. setdir DIR_SOUTH; The mapserver crashed immediately. How do I get this to work? Edited July 7, 2017 by gekigengar Quote Link to comment Share on other sites More sharing options...
0 Capuche Posted July 7, 2017 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 613 Joined: 07/05/12 Last Seen: April 15 Share Posted July 7, 2017 Replace sd = script_rid2sd(st); by sd = map_id2sd(st->rid); 1 Quote Link to comment Share on other sites More sharing options...
0 gekigengar Posted July 8, 2017 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 174 Reputation: 2 Joined: 08/30/13 Last Seen: October 1, 2017 Author Share Posted July 8, 2017 (edited) All fixed, thanks! Edited July 8, 2017 by gekigengar Quote Link to comment Share on other sites More sharing options...
Question
gekigengar
Hello, I have a script by AnnieRuru from my 2013 - 2014 server.
It used to work perfectly, until I decided to update my rAthena to the latest (From 2013/2014)
First it gave me an error during compilation for map_nick2sd( script_getstr(st,4));
Looking into the changes, I noticed there is now a feature for incomplete map names, so I put in ", false" for the 2nd parameter.
The compiler no longer gave me an error, and mapserver runs well, until made an NPC use the script to set a character's direction.
setdir DIR_SOUTH;
The mapserver crashed immediately.
How do I get this to work?
Edited by gekigengarLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.