r6671 - added 'is equipped' check to deal add

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
tangent
Noob
Noob
Posts: 3
Joined: 20 Feb 2009, 16:31
Noob?: No

r6671 - added 'is equipped' check to deal add

#1 Post by tangent »

i noticed this after i got banned from a certain server for trying to deal an item that was equipped.. so here's my solution
Index: Commands.pm
===================================================================
--- Commands.pm (revision 6671)
+++ Commands.pm (working copy)
@@ -1258,6 +1258,9 @@
} elsif ($arg[0] eq "add" && $arg[2] && $arg[2] !~ /\d+/) {
error T("Error in function 'deal_add' (Add Item to Deal)\n" .
"Amount must either be a number, or not specified.\n");
+ } elsif ($arg[0] eq "add" && $char->inventory->get($arg[1])->{equipped}) {
+ error T("Error in function 'deal_add' (Add Item to Deal)\n" .
+ "Equipped item may not be added to deal.\n");
} elsif ($arg[0] eq "add" && $arg[1] =~ /\d+/) {
if ($currentDeal{you_items} < 10) {
my $item = $char->inventory->get($arg[1]);

Locked