summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/type/statistics.erl')
-rw-r--r--src/type/statistics.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/type/statistics.erl b/src/type/statistics.erl
index bfdb2de..bced96f 100644
--- a/src/type/statistics.erl
+++ b/src/type/statistics.erl
@@ -48,7 +48,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-float_to_int (F) -> trunc(math:ceil(F)).
+ceil (F) ->
+ I = trunc(F),
+ case (F > I) of
+ true -> (I + 1);
+ _ -> I
+ end.
+
+float_to_int (F) -> trunc(ceil(F)).
min_max (Min, Max, V) -> min(Max, max(Min, V)).
average ([]) -> 0;
@@ -85,7 +92,7 @@ get_accuracy (Stats) -> Stats#statistics.accuracy.
get_double_hits (Stats) -> Stats#statistics.double_hits.
get_critical_hits (Stats) -> Stats#statistics.critical_hits.
-calc_for (Att, Wp) ->
+calc_for (Att, _Wp) ->
#statistics
{
movement_points = gentle_squared_growth(attributes:get_speed(Att)),