code: small tweaks

isolation_bkp/dynres
Dominik Madarász 2021-08-10 17:42:23 +02:00
parent f56c45e195
commit 6274bb34b0
3 changed files with 5 additions and 6 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;
}