Payment costs calculation: negative basket sums and

Hello there,

I got a question concerning the calculation of payment costs, as in payment.php lines 191-193:

if ( ($dRet * -1 ) > $dBaseprice ) {
    $dRet = $dBaseprice;
}

The method calculates costs that are added to the basket for the chosen payment type, based on the oxaddsumtype and oxaddsum values. However, I do not clearly understand the purpose of above code block.

This becomes important to me as the current project involves baskets with negative total basket sums, and the above lines of code result in additional payment costs of 100% of the (negative) basket sum – even though the payment costs are set to zero in the backend. For example: initially dRet is zero, dBaseprice is -10, because of the above code block dRet becomes -10.

Any help is very appreciated; I do not simply want to change this lines of code as they surely have a purpose.
Thanks alot,
Richard