improve mouse picking

isolation_bkp/dynres
Dominik Madarász 2022-08-09 17:54:00 +02:00
parent ca2ded9554
commit 079819e8d1
2 changed files with 4 additions and 5 deletions

View File

@ -184,7 +184,7 @@ void PlayerClosestInteractable(ecs_iter_t *it){
in[i].pick_ent = closest_pick;
if (in[i].pick)
in[i].sel_ent = closest_pick;
in[i].sel_ent = (in[i].sel_ent == closest_pick) ? 0 : closest_pick;
}
}

View File

@ -297,7 +297,9 @@ void InspectContainers(ecs_iter_t *it) {
for (int i = 0; i < it->count; ++i) {
if (!in[i].pick) continue;
in[i].storage_ent = in[i].pick_ent;
if ((in[i].sel_ent && ecs_get(it->world, in[i].sel_ent, ItemContainer)) || !in[i].sel_ent)
in[i].storage_ent = in[i].sel_ent;
}
}
@ -342,6 +344,3 @@ void HarvestIntoContainers(ecs_iter_t *it) {
}
}
}