improve mouse picking
parent
ca2ded9554
commit
079819e8d1
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue