stack, to the topmost one is picked up first.
extern void actor_pick(struct MapObj * mo)
{
- struct MapObj * picked;
- for (picked = world.map_objs; NULL != picked; picked = picked->next)
+ struct MapObj * picked = NULL;
+ struct MapObj * mo_i;
+ for (mo_i = world.map_objs; NULL != mo_i; mo_i = mo_i->next)
{
- if (picked != mo && yx_uint16_cmp(&picked->pos, &mo->pos))
+ if (mo_i != mo && yx_uint16_cmp(&mo_i->pos, &mo->pos))
{
- break;
+ picked = mo_i;
}
}
if (NULL != picked)
/* Actor "mo" tries to drop from inventory object indexed by number mo->args. */
extern void actor_drop(struct MapObj * mo);
-/* Actor "mo" tries to pick up object from ground into its inventory. */
+/* Actor "mo" tries to pick up topmost object from ground into its inventory. */
extern void actor_pick(struct MapObj * mo);
/* Actor "mo" tries to use inventory object indexed by number mo->args.