Issue information

Issue ID
#2666
Status
Fixed
Severity
Fair
Started
Hercules Elf Bot
Jan 14, 2009 21:38
Last Post
Hercules Elf Bot
Apr 18, 2012 15:45
Confirmation
N/A

Hercules Elf Bot - Jan 14, 2009 21:38

Originally posted by [b]hermematon[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=2666

When you make changes of Zeny in scripts that changes are not logged in the ZenyLog.

CODE
set Zeny,Zeny-1000000;
set Zeny,Zeny+1000000;


To fix this i make this code (its seems to works but maybe will need revision):

In file "\src\map\script.c" ("BUILDIN_FUNC(set)") change this:

CODE
    if( is_string_variable(name) )
        set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
    else
        set_reg(st,sd,num,name,(void*)script_getnum(st,3),script_getref(st,2));


to this:

CODE
    if( is_string_variable(name) )
        set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
    else {
        if( (strcmp(name,"Zeny")==0) && (log_config.zeny) )
            log_zeny(sd, "N", sd, (int)(script_getnum(st,3)-sd->status.zeny));
        set_reg(st,sd,num,name,(void*)script_getnum(st,3),script_getref(st,2));
    }


That will make to after change the "variable" Zeny log the amount changed. I hope this helps.

Regards.

This post has been edited by hermematon: Jan 25 2009, 12:33 AM

Hercules Elf Bot - Dec 26, 2011 11:21

Originally posted by [b]Ind[/b]
pc_setparam in SP_ZENY doesn't have any log transactions, what kind of log should we use? or create a new one?oO

This post has been edited by Ind on Dec 26, 2011 11:26

Hercules Elf Bot - Dec 29, 2011 15:31

Originally posted by [b]Ind[/b]
Fixed in [rev=15311]