… | |
… | |
248 | { |
248 | { |
249 | /* Basically, if the food value is something that is creatable |
249 | /* Basically, if the food value is something that is creatable |
250 | * under the limits of the spell and it is higher than |
250 | * under the limits of the spell and it is higher than |
251 | * the item we have now, take it instead. |
251 | * the item we have now, take it instead. |
252 | */ |
252 | */ |
253 | if (at_tmp->stats.food <= food_value && (!at || at_tmp->stats.food > at->stats.food)) |
253 | if (at_tmp->stats.food <= food_value |
|
|
254 | && (!at |
|
|
255 | || at_tmp->stats.food > at->stats.food |
|
|
256 | || (at_tmp->stats.food == at->stats.food |
|
|
257 | && at_tmp->weight < at->weight))) |
254 | at = at_tmp; |
258 | at = at_tmp; |
255 | } |
259 | } |
256 | } |
260 | } |
257 | } |
261 | } |
258 | /* Pretty unlikely (there are some very low food items), but you never |
262 | /* Pretty unlikely (there are some very low food items), but you never |