| 298 | } |
| 299 | |
| 300 | bool MapExtras::Block::setDesignationAt(df::coord2d p, df::tile_designation des, int32_t priority) |
| 301 | { |
| 302 | if(!valid) return false; |
| 303 | dirty_designations = true; |
| 304 | designated_tiles[(p.x&15) + (p.y&15)*16] = true; |
| 305 | //printf("setting block %d/%d/%d , %d %d\n",x,y,z, p.x, p.y); |
| 306 | index_tile(designation,p) = des; |
| 307 | if((des.bits.dig || des.bits.smooth) && block) { |
| 308 | block->flags.bits.designated = true; |
| 309 | // if priority is not specified, keep the existing priority if it |
| 310 | // is set. otherwise default to 4000. |
| 311 | if (priority <= 0) |
| 312 | priority = priorityAt(p); |
| 313 | if (priority <= 0) |
| 314 | priority = 4000; |
| 315 | setPriorityAt(p, priority); |
| 316 | } |
| 317 | return true; |
| 318 | } |
| 319 | |
| 320 | |
| 321 | int32_t MapExtras::Block::priorityAt(df::coord2d pos) |
no test coverage detected