| 1176 | } |
| 1177 | |
| 1178 | bool MapExtras::Block::addItemOnGround(df::item *item) |
| 1179 | { |
| 1180 | if (!block) |
| 1181 | return false; |
| 1182 | |
| 1183 | init_item_counts(); |
| 1184 | |
| 1185 | bool inserted; |
| 1186 | insert_into_vector(block->items, item->id, &inserted); |
| 1187 | |
| 1188 | if (inserted) |
| 1189 | { |
| 1190 | int &count = index_tile(item_counts,item->pos); |
| 1191 | |
| 1192 | if (count++ == 0) |
| 1193 | { |
| 1194 | index_tile(occupancy,item->pos).bits.item = true; |
| 1195 | index_tile(block->occupancy,item->pos).bits.item = true; |
| 1196 | } |
| 1197 | } |
| 1198 | |
| 1199 | return inserted; |
| 1200 | } |
| 1201 | |
| 1202 | bool MapExtras::Block::removeItemOnGround(df::item *item) |
| 1203 | { |
nothing calls this directly
no test coverage detected