code: small tweaks
parent
f56c45e195
commit
6274bb34b0
|
@ -101,7 +101,6 @@ void RegenerateHP(ecs_iter_t *it) {
|
||||||
|
|
||||||
void SystemsImport(ecs_world_t *ecs) {
|
void SystemsImport(ecs_world_t *ecs) {
|
||||||
ECS_MODULE(ecs, Systems);
|
ECS_MODULE(ecs, Systems);
|
||||||
ECS_IMPORT(ecs, Components);
|
|
||||||
|
|
||||||
ECS_SYSTEM(ecs, MovementImpulse, EcsOnLoad, components.Input, components.Velocity);
|
ECS_SYSTEM(ecs, MovementImpulse, EcsOnLoad, components.Input, components.Velocity);
|
||||||
//ECS_SYSTEM(ecs, DemoPlaceIceBlock, EcsOnLoad, components.Input, components.Position);
|
//ECS_SYSTEM(ecs, DemoPlaceIceBlock, EcsOnLoad, components.Input, components.Position);
|
||||||
|
|
|
@ -19,7 +19,7 @@ void MovementImpulse(ecs_iter_t *it) {
|
||||||
Velocity *v = ecs_column(it, Velocity, 2);
|
Velocity *v = ecs_column(it, Velocity, 2);
|
||||||
|
|
||||||
for (int i = 0; i < it->count; i++) {
|
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);
|
double speed = PLR_MOVE_SPEED * (in[i].sprint ? PLR_MOVE_SPEED_MULT : 1.0);
|
||||||
if (zpl_abs(v[i].x) < speed && in[i].x)
|
if (zpl_abs(v[i].x) < speed && in[i].x)
|
||||||
v[i].x = in[i].x*speed;
|
v[i].x = in[i].x*speed;
|
||||||
|
|
|
@ -8,7 +8,7 @@ void EnterOrLeaveVehicle(ecs_iter_t *it) {
|
||||||
for (int i = 0; i < it->count; i++) {
|
for (int i = 0; i < it->count; i++) {
|
||||||
if (!in[i].use) continue;
|
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;
|
size_t ents_count;
|
||||||
int64_t *ents = world_chunk_query_entities(it->entities[i], &ents_count, 2);
|
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_FORCE 19.8f
|
||||||
#define VEHICLE_ACCEL 0.17f
|
#define VEHICLE_ACCEL 0.27f
|
||||||
#define VEHICLE_DECEL 0.28f
|
#define VEHICLE_DECEL 0.28f
|
||||||
#define VEHICLE_STEER 0.11f
|
#define VEHICLE_STEER 0.11f
|
||||||
#define VEHICLE_STEER_MUL 0.087f
|
#define VEHICLE_STEER_MUL 0.087f
|
||||||
|
@ -72,7 +72,7 @@ void VehicleHandling(ecs_iter_t *it) {
|
||||||
|
|
||||||
for (int j = 0; j < 4; j++) {
|
for (int j = 0; j < 4; j++) {
|
||||||
// NOTE(zaklaus): Perform seat cleanup
|
// 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;
|
veh[i].seats[j] = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue