From 34624b97980e256256897832eda4c7a8c00ca725 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 20 Sep 2014 18:18:07 -0300 Subject: Fixed Bug 8301 reloadscript now clears npc-spawned (by warpportal script command) warps properly. Special Thanks to Emistry, Cydh http://hercules.ws/board/tracker/issue-8301-warpportal-reloadscript-map-server-error/ Signed-off-by: shennetsind --- src/map/script.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index 3b5264de9..f46ee78fe 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -15909,8 +15909,7 @@ BUILDIN(warpportal) { struct block_list* bl; bl = map->id2bl(st->oid); - if( bl == NULL ) - { + if( bl == NULL ) { ShowError("script:warpportal: npc is needed\n"); return false; } @@ -15924,6 +15923,9 @@ BUILDIN(warpportal) { if( map_index == 0 ) return true;// map not found + if( bl->type == BL_NPC ) + unit->bl2ud2(bl); // ensure nd->ud is safe to edit + group = skill->unitsetting(bl, AL_WARP, 4, spx, spy, 0); if( group == NULL ) return true;// failed -- cgit v1.2.3-70-g09d2