]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commit
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)
commitac9fba402abf745436adf0ecaa8f90347708ff53
treef4ee547e9fd2f8ad0f1f65ec4c588a844eaa336c
parent611ca3ef85a52d3272aeca943f0b3a97e3aa52bb
parentc292e3983f92ce2260168a04cea27fb75bec782e
Merge branch 'martin-t/damagetext' into 'master'

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
qcsrc/server/mutators/events.qh