taisei/src/plrmodes
laochailan 6d16d577ab
fix a replay desync in the reimu_b code between clang and gcc
The desync was caused by implementation specific behavior with complex numbers. Depending on the compiler, multiplying a complex-type number 1+0*I by -1 will either yield -1-0*I (gcc) or -1+0*I (clang). Complex functions with a branch cut along the negative real axis, such as carg will respond drastically to such a difference in zero sign.

In the case of carg, the difference incurred by this is exactly M_TAU, which is irrelevant in most applications. In reimu_b, however there was one instance where the branch cut of carg was not handled (carg(a/b) != carg(a) - carg(b)). Even without the zero-sign inconsistency, this was a bug causing bullets to be absorbed by gaps that should not have been.

This commit fixes said bug (and simplifies two instances of unproblematic but needlessly complicated math). The result is that (i) the gaps now function properly, and (ii) new replays do not desync between gcc and clang anymore. Note, that this change slightly breaks replay compatibility to older replays that showed the buggy behavior of the gaps.
2021-06-02 08:15:26 +02:00
..
entities.h Refactor entity system (#214) 2020-04-17 10:18:53 +03:00
marisa.c Cutscenes (#249) 2020-11-28 12:11:10 +02:00
marisa.h Coroutinize MarisaB (#216) 2020-04-22 22:33:38 +03:00
marisa_a.c MarisaA: fix deprecations 2021-02-22 01:03:37 +02:00
marisa_a.h make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
marisa_a_entities.h Refactor entity system (#214) 2020-04-17 10:18:53 +03:00
marisa_b.c reduce out-of-bounds lifetime of player bullets 2021-02-18 20:13:06 +02:00
marisa_b.h make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
marisa_b_entities.h Coroutinize MarisaB (#216) 2020-04-22 22:33:38 +03:00
meson.build Add Reimu Hakurei as a playable character (#106) 2018-08-11 22:13:48 +03:00
reimu.c Cutscenes (#249) 2020-11-28 12:11:10 +02:00
reimu.h use custom ents for Reimu; cleanup Marisa; etc. 2020-04-06 04:34:55 +03:00
reimu_a.c reduce out-of-bounds lifetime of player bullets 2021-02-18 20:13:06 +02:00
reimu_a_entities.h Refactor entity system (#214) 2020-04-17 10:18:53 +03:00
reimu_b.c fix a replay desync in the reimu_b code between clang and gcc 2021-06-02 08:15:26 +02:00
reimu_b_entities.h Refactor entity system (#214) 2020-04-17 10:18:53 +03:00
youmu.c Cutscenes (#249) 2020-11-28 12:11:10 +02:00
youmu.h Coroutinize YoumuB (#215) 2020-04-21 20:11:09 +03:00
youmu_a.c YoumuA: fix deprecations 2021-02-20 01:54:47 +02:00
youmu_a.h make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
youmu_a_entities.h Refactor entity system (#214) 2020-04-17 10:18:53 +03:00
youmu_b.c reduce out-of-bounds lifetime of player bullets 2021-02-18 20:13:06 +02:00
youmu_b.h make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
youmu_b_entities.h Refactor entity system (#214) 2020-04-17 10:18:53 +03:00