| 1124 | } |
| 1125 | |
| 1126 | static bool linkForConstruct(df::job* &job, df::building *bld) |
| 1127 | { |
| 1128 | if (!checkBuildingTiles(bld, false)) |
| 1129 | return false; |
| 1130 | |
| 1131 | auto ref = df::allocate<df::general_ref_building_holderst>(); |
| 1132 | if (!ref) |
| 1133 | { |
| 1134 | Core::printerr("Could not allocate general_ref_building_holderst\n"); |
| 1135 | return false; |
| 1136 | } |
| 1137 | |
| 1138 | linkBuilding(bld); |
| 1139 | |
| 1140 | ref->building_id = bld->id; |
| 1141 | |
| 1142 | job = new df::job(); |
| 1143 | job->job_type = df::job_type::ConstructBuilding; |
| 1144 | job->pos = df::coord(bld->centerx, bld->centery, bld->z); |
| 1145 | job->general_refs.push_back(ref); |
| 1146 | |
| 1147 | bld->jobs.push_back(job); |
| 1148 | |
| 1149 | Job::linkIntoWorld(job); |
| 1150 | |
| 1151 | return true; |
| 1152 | } |
| 1153 | |
| 1154 | static bool needsItems(df::building *bld) |
| 1155 | { |
no test coverage detected