]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/damagetext' into 'master'
authorMario <zacjardine@y7mail.com>
Sat, 22 Oct 2016 01:13:49 +0000 (01:13 +0000)
committerMario <zacjardine@y7mail.com>
Sat, 22 Oct 2016 01:13:49 +0000 (01:13 +0000)
fix damage text rounding errors when accumulating damage

This fixes MG reporting wrong damage when accumulated after passing through a wall (or similar situations where damage is not a whole number) while keeping rounding behavior for weapons like mortar.

I used MinceR's idea of multiplying the damage by 100 and sending the decimal part inside the short instead of using float to keep bandwidth the same.

Now that i think about it, this could cause trouble if the damage dealt is higher than 655 (because 656*100 won't fit in short). However health and armor max is 200 so it shouldn't happen unless we start sending damage text for vehicles as well.

See merge request !365

1  2 
qcsrc/server/mutators/events.qh

Simple merge