… | |
… | |
2314 | * |
2314 | * |
2315 | * who - the player |
2315 | * who - the player |
2316 | * op - the item we want to light |
2316 | * op - the item we want to light |
2317 | * ligher - the lighter or 0 if a lighter has yet to be found |
2317 | * ligher - the lighter or 0 if a lighter has yet to be found |
2318 | */ |
2318 | */ |
|
|
2319 | object * |
2319 | object *auto_apply_lighter (object *who, object *op, object *lighter) |
2320 | auto_apply_lighter (object *who, object *op, object *lighter) |
2320 | { |
2321 | { |
2321 | if (lighter == 0) |
2322 | if (lighter == 0) |
2322 | { |
2323 | { |
2323 | for (object *tmp = who->inv; tmp; tmp = tmp->below) |
2324 | for (object *tmp = who->inv; tmp; tmp = tmp->below) |
2324 | { |
2325 | { |
… | |
… | |
2371 | int is_player_env = 0; |
2372 | int is_player_env = 0; |
2372 | |
2373 | |
2373 | item = find_marked_object (who); |
2374 | item = find_marked_object (who); |
2374 | if (item) |
2375 | if (item) |
2375 | { |
2376 | { |
2376 | if (!auto_apply_lighter (who, 0, lighter)) |
2377 | if (!auto_apply_lighter (who, item, lighter)) |
2377 | return; |
2378 | return; |
2378 | |
2379 | |
2379 | /* Perhaps we should split what we are trying to light on fire? |
2380 | /* Perhaps we should split what we are trying to light on fire? |
2380 | * I can't see many times when you would want to light multiple |
2381 | * I can't see many times when you would want to light multiple |
2381 | * objects at once. |
2382 | * objects at once. |