Fix check for projectiles - acceleration in either horizontal axis is sufficient

This commit is contained in:
Dominic Szablewski 2023-08-15 17:51:57 +02:00
parent d7204cad0f
commit 5fcf2feec8

View file

@ -168,7 +168,7 @@ void weapons_update() {
(weapon->update_func)(weapon);
// Handle projectiles
if (weapon->acceleration.x != 0 && weapon->acceleration.z != 0) {
if (weapon->acceleration.x != 0 || weapon->acceleration.z != 0) {
weapon->velocity = vec3_add(weapon->velocity, vec3_mulf(weapon->acceleration, 30 * system_tick()));
weapon->velocity = vec3_sub(weapon->velocity, vec3_mulf(weapon->velocity, weapon->drag * 30 * system_tick()));
weapon->position = vec3_add(weapon->position, vec3_mulf(weapon->velocity, 30 * system_tick()));