diff --git a/doc/script_commands.txt b/doc/script_commands.txt index eb80e32a7e..68ef25faeb 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -7489,7 +7489,7 @@ rand(2,5) would result in 2,3,4 or 5 --------------------------------------- -*viewpoint ,,,,; +*viewpoint ,,,,{,}; This command will mark places on the mini map in the client connected to the invoking character. It uses the normal X and Y coordinates from the main map. diff --git a/src/map/script.cpp b/src/map/script.cpp index 31260b7426..e988d25613 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -6687,15 +6687,17 @@ BUILDIN_FUNC(viewpoint) int type,x,y,id,color; TBL_PC* sd; + if (!script_charid2sd(7, sd)) { + st->state = END; + return SCRIPT_CMD_FAILURE; + } + type=script_getnum(st,2); x=script_getnum(st,3); y=script_getnum(st,4); id=script_getnum(st,5); color=script_getnum(st,6); - if( !script_rid2sd(sd) ) - return SCRIPT_CMD_SUCCESS; - clif_viewpoint(sd,st->oid,type,x,y,id,color); return SCRIPT_CMD_SUCCESS; @@ -24496,7 +24498,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF2(enableitemuse,"enable_items",""), BUILDIN_DEF2(disableitemuse,"disable_items",""), BUILDIN_DEF(cutin,"si"), - BUILDIN_DEF(viewpoint,"iiiii"), + BUILDIN_DEF(viewpoint,"iiiii?"), BUILDIN_DEF(heal,"ii?"), BUILDIN_DEF(itemheal,"ii?"), BUILDIN_DEF(percentheal,"ii?"),