… | |
… | |
92 | if ($pay <= $who->{bank_balance}) { |
92 | if ($pay <= $who->{bank_balance}) { |
93 | $who->{bank_balance} -= $pay; |
93 | $who->{bank_balance} -= $pay; |
94 | if ($currency eq "royalty") { |
94 | if ($currency eq "royalty") { |
95 | my $money = cf::object::new "royalty"; |
95 | my $money = cf::object::new "royalty"; |
96 | $money->set_property (1, 24, $amount); |
96 | $money->set_property (1, 24, $amount); |
97 | $money->insert_in_ob ($who); |
97 | $money->take ($who); |
98 | } else { |
98 | } else { |
99 | my $money = cf::object::new $currency . "coin"; |
99 | my $money = cf::object::new $currency . "coin"; |
100 | $money->set_property (1, 24, $amount); |
100 | $money->set_property (1, 24, $amount); |
101 | $money->insert_in_ob ($who); |
101 | $money->take ($who); |
102 | } |
102 | } |
103 | return "Withdrew $amount $currency"; |
103 | return "Withdrew $amount $currency"; |
104 | } else { |
104 | } else { |
105 | return "You don't have that much money on your bank account."; |
105 | return "You don't have that much money on your bank account."; |
106 | } |
106 | } |