in reply to Re: Todo list should additional levels be added
in thread Todo list should additional levels be added
--- Experience.pm.orig 2004-10-26 15:52:49.000000000 -0700 +++ Experience.pm 2004-10-26 16:22:00.571382400 -0700 @@ -37,20 +37,23 @@ sub BEGIN # "level settings" node # sub getLevel { - my ($USER) = @_; + my ($USER, $respect_god) = @_; getRef($USER); + my $isGod = $respect_god && isGod($USER); my $exp = $$USER{experience}; my $LSETTINGS = getVars(getNode('level experience', 'setting' +)); $LSETTINGS or return; my $cnt = 1; - while (exists $$LSETTINGS{$cnt} and $exp >= $$LSETTINGS{$cnt}) { + while (exists $$LSETTINGS{$cnt} and + ($exp >= $$LSETTINGS{$cnt} || $isGod)) { $cnt++; } - #this finds the /next/ level, so we return the one below it. + #this finds the /next/ level, so we return the one below it + #(but return one more than the highest level for gods if requ +ested). - $cnt-1; + return $isGod ? $cnt : --$cnt; } ##################################################################### +###
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Todo list should additional levels be added
by demerphq (Chancellor) on Sep 24, 2005 at 09:50 UTC |