From 262f337b7bd4abd532c00de5e81761403b6a634c Mon Sep 17 00:00:00 2001 From: Alex Kerr Date: Tue, 10 Feb 2015 00:34:35 +0000 Subject: [PATCH] Fixed gold generation --- lib/OSRIC/Character.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/OSRIC/Character.pm b/lib/OSRIC/Character.pm index 8b18612..a08c794 100644 --- a/lib/OSRIC/Character.pm +++ b/lib/OSRIC/Character.pm @@ -189,12 +189,12 @@ sub generate_gold my $self = shift; # Get the classes and sort by the highest starting gold (see page 28): - my @sorted = sort { "OSRIC::Class::$a"->max_starting_gold <=> - "OSRIC::Class::$b"->max_starting_gold } + my @sorted = sort { "OSRIC::Class::$b"->max_starting_gold <=> + "OSRIC::Class::$a"->max_starting_gold } @{$self->{personal}->{classes}}; # 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: