diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-10-29 18:51:44 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-10-29 18:51:44 +0100 |
| commit | c0d1f750783f00fb82b6ec2cce11e0ce423acf02 (patch) | |
| tree | 30086a10c65f3dcad096e28699ada5297f7e7917 /src/throwables.c | |
| parent | 04024078984bbaf84f34352061da2a224ecdb0b0 (diff) | |
editor work + refactor
Diffstat (limited to 'src/throwables.c')
| -rw-r--r-- | src/throwables.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/throwables.c b/src/throwables.c index 86a9734..c18d410 100644 --- a/src/throwables.c +++ b/src/throwables.c @@ -33,14 +33,10 @@ bool check_if_throwable_collided_with_object(throwable* b, vec3f oldpos, vec3f n if (b->position.z <= o.h + o.size.z && b->position.z >= o.h) { box obj_box = get_box_of_square((vec3f){o.position.x, o.position.y, o.h}, o.size); - if (o.type == OBJECT_PLANTBOX1 && oldpos.x < o.position.x && newpos.x > o.position.x) { - log_infox("intersect {%.2f %.2f}{%.2f %.2f} {%.2f %.2f}{%.2f %.2f}", - oldpos.x, oldpos.y, newpos.x, newpos.y, o.position.x, o.position.y, o.position.x, o.position.y + o.size.y); - - //if (lines_intersect((vec2f){15.99, 8.58}, (vec2f){16.05, 8.58}, (vec2f){16.00, 8.00}, (vec2f){16.00, 9.00})) { - // log_info("POOOp"); - //} - } + //if (o.type == OBJECT_PLANTBOX1 && oldpos.x < o.position.x && newpos.x > o.position.x) { + // log_infox("intersect {%.2f %.2f}{%.2f %.2f} {%.2f %.2f}{%.2f %.2f}", + // oldpos.x, oldpos.y, newpos.x, newpos.y, o.position.x, o.position.y, o.position.x, o.position.y + o.size.y); + //} // top if (lines_intersect((vec2f){.x = oldpos.x, .y = oldpos.y}, (vec2f){.x = newpos.x, .y = newpos.y}, @@ -111,7 +107,6 @@ void update_throwables_server() { throwables[i].rotation += SERVER_TICK_RATE*3.0f*throwables[i].bounces; - throwables[i].alive_time += SERVER_TICK_RATE; if (throwables[i].alive_time >= 2.0f) { |
