Fixed gold generation

This commit is contained in:
Alex Kerr 2015-02-10 00:34:35 +00:00
parent 591c8e5dae
commit 262f337b7b

View File

@ -189,12 +189,12 @@ sub generate_gold
my $self = shift; my $self = shift;
# Get the classes and sort by the highest starting gold (see page 28): # Get the classes and sort by the highest starting gold (see page 28):
my @sorted = sort { "OSRIC::Class::$a"->max_starting_gold <=> my @sorted = sort { "OSRIC::Class::$b"->max_starting_gold <=>
"OSRIC::Class::$b"->max_starting_gold } "OSRIC::Class::$a"->max_starting_gold }
@{$self->{personal}->{classes}}; @{$self->{personal}->{classes}};
# Generate the starting gold: # Generate the starting gold:
$self->{wealth}->{coins} = "OSRIC::Class::$classes[0]"->get_gold; $self->{wealth}->{coins} = "OSRIC::Class::$sorted[0]"->get_gold;
} }
# Encodes the character to JSON: # Encodes the character to JSON: