# HG changeset patch # User nemo # Date 1250020561 0 # Node ID d633bc70c893da08430c0c37b12c720c1b496f48 # Parent ac9a2f2431c751819964e3f305f6bb148f0b6042 prevent overflow diff -r ac9a2f2431c7 -r d633bc70c893 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Sun Aug 09 22:07:57 2009 +0000 +++ b/hedgewars/uFloat.pas Tue Aug 11 19:56:01 2009 +0000 @@ -273,8 +273,8 @@ function hwRound(const t: hwFloat): LongInt; begin -if t.isNegative then hwRound:= -t.Round - else hwRound:= t.Round +if t.isNegative then hwRound:= -(t.Round and $7FFFFFFF) + else hwRound:= t.Round and $7FFFFFFF end; function hwAbs(const t: hwFloat): hwFloat;