Skip to content

Commit

Permalink
Fixed readparam when 2nd parameter is a variable
Browse files Browse the repository at this point in the history
Related issue #2276
  • Loading branch information
Atemo committed Aug 4, 2017
1 parent 627a178 commit 9d6b3d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion npc/custom/quests/hunting_missions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ OnNPCKillEvent:
if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) {
set .@Mission_Count, getvar(#Mission_Count, $@partymembercid[.@i]);
set .@Mission0, getvar(Mission0, $@partymembercid[.@i]);
set .@HP, getvar(HP, $@partymembercid[.@i]);
set .@HP, readparam(HP, $@partymembercid[.@i]);

if (.@Mission_Count && .@Mission0 && .@HP > 0) {
getmapxy(.@map2$,.@x2,.@y2,UNITTYPE_PC);
Expand Down
9 changes: 6 additions & 3 deletions src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -8152,12 +8152,15 @@ BUILDIN_FUNC(readparam)
{
int value;
struct script_data *data = script_getdata(st, 2);
TBL_PC *sd;
TBL_PC *sd = NULL;

if( script_hasdata(st, 3) ){
if( script_isint(st, 3) ){
struct script_data *data2 = script_getdata(st, 3);

get_val(st, data2);
if (data_isint(data2) || script_getnum(st, 3)) {
script_charid2sd(3, sd);
}else{
} else if (data_isstring(data2)) {
script_nick2sd(3, sd);
}
}else{
Expand Down

0 comments on commit 9d6b3d0

Please sign in to comment.