TO ANYONE WHO USES THIS BEFORE THE REAL FIX COMES OUT, PLEASE RESPECT ME AND DO NOT POST THE EDITED FILES FOR OTHERS TO DOWNLOAD. IF THEY WANT THE TEMPORARY FIX LET THEM APPLY IT THEMSELVES.
Not to be a dick, but I just hate spoonfeeding.
edit: I received a PM stating that this fix does indeed work with vending.
I believe this will fix the problems relating to storage and selling and even vending (though I have no way to test this). In src\network\receive\servertype0.pm edit the following function to what I have:
Code: Select all
sub parse_items_nonstackable {
my ($self, $args) = @_;
$self->parse_items($args, $self->items_nonstackable($args), sub {
my ($item) = @_;
# message TF("In P_I_N the item %s has an amount of %s\n", $item->{name}, $item->{amount});
#$item->{placeEtcTab} = $item->{identified} & (1 << 2);
$item->{amount} = 1 unless ($item->{amount});
$item->{broken} = $item->{identified} & (1 << 1) unless exists $item->{broken};
$item->{idenfitied} = $item->{identified} & (1 << 0);
})
}
Obviously this is not a fix for the real problem in that the item packet was not parsed properly and therefore the item structure is malformed. I am honestly do not know enough about the packets or how to parse them to do much more on this subject.
EVERYTHING BELOW THIS LINE IS OUTDATED
-----------------------------------------------------------------------------
I don't have all the zeny or characters in the world to test all this stuff out (I just started last night). However ChrstphR and myself have come up with a workaround for the autosell problem:
after the line in \src\network\receive\ServerType0.pm (around 3600~)
Code: Select all
my $item = $char->inventory->getByServerIndex($index);
add in:
Code: Select all
if ($item->{amount} == 0) {
$item->{amount} = 1; # why would that ever return 0 in the first place is beyond me.
}
I am well aware this does nothing to address the underlying issue of why the items are returning 0 for the amount value, however I don't know perl nor is the source code the easiest thing to navigate in the world, so this workaround can be used until the real devs figure out the root issue.
This same hax concept can be used to "fix" autostorage as well...
in src\network\send.pm
replace the following functions with what I have now:
Code: Select all
sub sendStorageAdd {
my ($self, $index, $amount) = @_;
# message TF("%s - Amount trying to add\n", $amount);
if (!$amount) {
$amount = 1;
}
$self->sendToServer($self->reconstruct({switch => 'storage_item_add', index => $index, amount => $amount}));
debug "Sent Storage Add: $index x $amount\n", "sendPacket", 2;
}
sub sendStorageGet {
my ($self, $index, $amount) = @_;
# message TF("%s - Amount trying to take\n", $amount);
if (!$amount) {
$amount = 1;
}
$self->sendToServer($self->reconstruct({switch => 'storage_item_remove', index => $index, amount => $amount}));
debug "Sent Storage Get: $index x $amount\n", "sendPacket", 2;
}
These were the only two problems relating to items that effect me currently so I will not be trying to fix the vending or anything like that (I dont have a merchant yet anyway).