Issue information

Issue ID
#6888
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Nov 13, 2012 2:34
Last Post
Hercules Elf Bot
Nov 14, 2012 2:27
Confirmation
Yes (3)
No (0)

Hercules Elf Bot - Nov 13, 2012 2:34

Originally posted by [b]MarkZD[/b]
[attachment=4422:cashpoints-err.jpg]

[attachment=4423:IncorrectMessageCashPoints.jpg]


I have 41 @cash points, so I use @cash -42.

Expected Result:
[quote]Removed 42 cash points. Total -1 points.[/quote]

Or maybe:
[quote]Removed 42 cash points. Total 0 point.[/quote]

Or maybe:
[quote]You can't remove more points than you have.[/quote]

But, current result is:
[quote]Removed -42 cash points. Total 41 points.[/quote]

The same happens to @points

Also, 'Removed "-"42' seems a typo: -(-42).

Since 16923
When @zeny value is smaller than what you have, no message is produced.

We can check it's return value, as it'll return 1 only in this case, because in atcommand it's checked to not enter any value smaller than 0.

Also, there's a bug in this fix:
[CODE]
if(zeny > 0)
pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL);
else
pc_payzeny(sd,zeny,LOG_TYPE_COMMAND,NULL);
[/CODE]

The value zeny in the else, should receive a negative signal.
[CODE]
if(zeny > 0)
pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL);
else
pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL);
[/CODE]

This post has been edited by MarkZD on Nov 13, 2012 2:47

Hercules Elf Bot - Nov 13, 2012 4:01

Originally posted by [b]mofo[/b]
this update might also be causing the map crashes on my server whenever someone sells an item to an npc. anyone having that same problem?

Hercules Elf Bot - Nov 13, 2012 5:14

Originally posted by [b]MarkZD[/b]
[quote name='mofo' timestamp='1352779319' post='15621']
this update might also be causing the map crashes on my server whenever someone sells an item to an npc. anyone having that same problem?
[/quote]

Yep, it's caused by this.

[quote name='MarkZD' timestamp='1352783384' post='15626']
Apparently, it's because of this condition in pc_getzeny.[CODE]if(!sd) tsd = sd;[/CODE]Which should be:[CODE]if(!tsd) tsd = sd;[/CODE]
[/quote]
http://rathena.org/board/tracker/issue-6890-after-16914/page__gopid__15627#entry15627

Hercules Elf Bot - Nov 13, 2012 5:49

Originally posted by [b]exneval[/b]
Confirmed this

Hercules Elf Bot - Nov 14, 2012 2:27

Originally posted by [b]Lighta[/b]
[rev=16924]