From 6274bb34b0225f99f454902526f620aaad40d4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Tue, 10 Aug 2021 17:42:23 +0200 Subject: [PATCH] code: small tweaks --- code/modules/modules/systems.c | 1 - code/modules/source/system_onfoot.c | 2 +- code/modules/source/system_vehicle.c | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/code/modules/modules/systems.c b/code/modules/modules/systems.c index 1d9112a..8395f85 100644 --- a/code/modules/modules/systems.c +++ b/code/modules/modules/systems.c @@ -101,7 +101,6 @@ void RegenerateHP(ecs_iter_t *it) { void SystemsImport(ecs_world_t *ecs) { ECS_MODULE(ecs, Systems); - ECS_IMPORT(ecs, Components); ECS_SYSTEM(ecs, MovementImpulse, EcsOnLoad, components.Input, components.Velocity); //ECS_SYSTEM(ecs, DemoPlaceIceBlock, EcsOnLoad, components.Input, components.Position); diff --git a/code/modules/source/system_onfoot.c b/code/modules/source/system_onfoot.c index 45694b2..dbae2f2 100644 --- a/code/modules/source/system_onfoot.c +++ b/code/modules/source/system_onfoot.c @@ -19,7 +19,7 @@ void MovementImpulse(ecs_iter_t *it) { Velocity *v = ecs_column(it, Velocity, 2); for (int i = 0; i < it->count; i++) { - if (ecs_is_alive(world_ecs(), in[i].parent)) continue; + if (world_entity_valid(in[i].parent)) continue; double speed = PLR_MOVE_SPEED * (in[i].sprint ? PLR_MOVE_SPEED_MULT : 1.0); if (zpl_abs(v[i].x) < speed && in[i].x) v[i].x = in[i].x*speed; diff --git a/code/modules/source/system_vehicle.c b/code/modules/source/system_vehicle.c index 9f0bdf1..d0c5d18 100644 --- a/code/modules/source/system_vehicle.c +++ b/code/modules/source/system_vehicle.c @@ -8,7 +8,7 @@ void EnterOrLeaveVehicle(ecs_iter_t *it) { for (int i = 0; i < it->count; i++) { if (!in[i].use) continue; - if (!ecs_is_alive(world_ecs(), in[i].parent)) { + if (!world_entity_valid(in[i].parent)) { size_t ents_count; int64_t *ents = world_chunk_query_entities(it->entities[i], &ents_count, 2); @@ -52,8 +52,8 @@ void EnterOrLeaveVehicle(ecs_iter_t *it) { } } -#define VEHICLE_FORCE 12.8f -#define VEHICLE_ACCEL 0.17f +#define VEHICLE_FORCE 19.8f +#define VEHICLE_ACCEL 0.27f #define VEHICLE_DECEL 0.28f #define VEHICLE_STEER 0.11f #define VEHICLE_STEER_MUL 0.087f @@ -72,7 +72,7 @@ void VehicleHandling(ecs_iter_t *it) { for (int j = 0; j < 4; j++) { // NOTE(zaklaus): Perform seat cleanup - if (!ecs_is_alive(world_ecs(), veh[i].seats[j])) { + if (!world_entity_valid(veh[i].seats[j])) { veh[i].seats[j] = 0; continue; }