Is there a container at x,y. Optional: return count of containers at x,y */
| 2021 | |
| 2022 | /* Is there a container at x,y. Optional: return count of containers at x,y */ |
| 2023 | int |
| 2024 | container_at(coordxy x, coordxy y, boolean countem) |
| 2025 | { |
| 2026 | struct obj *cobj, *nobj; |
| 2027 | int container_count = 0; |
| 2028 | |
| 2029 | for (cobj = svl.level.objects[x][y]; cobj; cobj = nobj) { |
| 2030 | nobj = cobj->nexthere; |
| 2031 | if (Is_container(cobj)) { |
| 2032 | container_count++; |
| 2033 | if (!countem) |
| 2034 | break; |
| 2035 | } |
| 2036 | } |
| 2037 | return container_count; |
| 2038 | } |
| 2039 | |
| 2040 | staticfn boolean |
| 2041 | able_to_loot( |
no outgoing calls
no test coverage detected