… | |
… | |
134 | $who->message ("The shopkeeper says: Sorry, you can't sell money here.", cf::NDI_BROWN); |
134 | $who->message ("The shopkeeper says: Sorry, you can't sell money here.", cf::NDI_BROWN); |
135 | $what->insert_ob_in_ob ($who); |
135 | $what->insert_ob_in_ob ($who); |
136 | return 1; |
136 | return 1; |
137 | } |
137 | } |
138 | |
138 | |
139 | unless ($what->get_flag (cf::FLAG_IDENTIFIED)) { |
139 | if (!$what->get_flag (cf::FLAG_IDENTIFIED) && $what->need_identify) { |
140 | $who->message ("The shopkeeper says: Sorry, you can't sell unidentified stuff here.", cf::NDI_BROWN); |
140 | $who->message ("The shopkeeper says: Sorry, you can't sell unidentified stuff here.", cf::NDI_BROWN); |
141 | $what->insert_ob_in_ob ($who); |
141 | $what->insert_ob_in_ob ($who); |
142 | return 1; |
142 | return 1; |
143 | } |
143 | } |
144 | |
144 | |
145 | my $orig_value = $what->value; |
145 | my $orig_value = $what->value; |
146 | my $value = 0; |
146 | my $value = 0; |
147 | |
147 | |
148 | if ($name =~ m/\S/) { |
148 | if ($name =~ m/\S/) { |
149 | unless ($name =~ m/\d+\s*\S+/) { |
149 | unless ($name =~ m/\d+\s*\S+/) { |
150 | $who->message ("The shopkeeper says: Sorry, i don't recognize '$name' as currency. Please name your item like '10 royalty' or '10 platinum 2 silver'", cf::NDI_BROWN); |
150 | $who->message ("The shopkeeper says: Sorry, I don't recognize '$name' as currency. Please name your item like '10 royalty' or '10 platinum 2 silver'", cf::NDI_BROWN); |
151 | $what->insert_ob_in_ob ($who); |
151 | $what->insert_ob_in_ob ($who); |
152 | return 1; |
152 | return 1; |
153 | } |
153 | } |
154 | |
154 | |
155 | while ($name =~ s/^\s*(\d+)\s*(\S+)//) { |
155 | while ($name =~ s/^\s*(\d+)\s*(\S+)//) { |