mirror of
https://github.com/phoboslab/wipeout-rewrite
synced 2024-12-26 09:59:04 +01:00
Fix ebolt effect on AI not being frame rate dependent
This commit is contained in:
parent
339f130b94
commit
718a348109
1 changed files with 9 additions and 3 deletions
|
@ -525,10 +525,16 @@ void ship_ai_update_race(ship_t *self) {
|
|||
self->position = vec3_add(self->position, vec3_mulf(self->velocity, 0.015625 * 30 * system_tick()));
|
||||
|
||||
if (flags_is(self->flags, SHIP_ELECTROED)) {
|
||||
self->ebolt_effect_timer += system_tick();
|
||||
|
||||
if (self->ebolt_effect_timer > 0.1) {
|
||||
self->ebolt_effect_timer -= 0.1;
|
||||
|
||||
self->position = vec3_add(self->position, vec3(rand_float(-20, 20), rand_float(-20, 20), rand_float(-20, 20)));
|
||||
|
||||
if (rand_int(0, 50) == 0) {
|
||||
self->speed -= self->speed * 0.5 * 30 * system_tick();
|
||||
if (rand_int(0, 10) == 0) {
|
||||
self->speed -= self->speed * 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue