this really loads the objects into entity_list
| 182 | |
| 183 | //this really loads the objects into entity_list |
| 184 | bool Zone::LoadZoneObjects() |
| 185 | { |
| 186 | const auto &l = ObjectRepository::GetWhere( |
| 187 | content_db, |
| 188 | fmt::format( |
| 189 | "zoneid = {} AND (version = {} OR version = -1) {}", |
| 190 | zoneid, |
| 191 | instanceversion, |
| 192 | ContentFilterCriteria::apply() |
| 193 | ) |
| 194 | ); |
| 195 | |
| 196 | for (const auto &e : l) { |
| 197 | if (e.type == ObjectTypes::StaticLocked) { |
| 198 | const std::string &zone_short_name = ZoneName(e.zoneid, false); |
| 199 | |
| 200 | if (zone_short_name.empty()) { |
| 201 | continue; |
| 202 | } |
| 203 | |
| 204 | auto d = DoorsRepository::NewEntity(); |
| 205 | |
| 206 | d.zone = zone_short_name; |
| 207 | d.id = 1000000000 + e.id; |
| 208 | d.doorid = -1; |
| 209 | d.pos_x = e.xpos; |
| 210 | d.pos_y = e.ypos; |
| 211 | d.pos_z = e.zpos; |
| 212 | d.heading = e.heading; |
| 213 | d.name = Strings::Replace(e.objectname, "_ACTORDEF", ""); |
| 214 | d.dest_zone = "NONE"; |
| 215 | d.incline = e.incline; |
| 216 | d.client_version_mask = 0xFFFFFFFF; |
| 217 | |
| 218 | if (e.size_percentage == 0) { |
| 219 | d.size = 100; |
| 220 | } |
| 221 | |
| 222 | switch (d.opentype = e.solid_type) |
| 223 | { |
| 224 | case 0: |
| 225 | d.opentype = 31; |
| 226 | break; |
| 227 | case 1: |
| 228 | d.opentype = 9; |
| 229 | break; |
| 230 | } |
| 231 | |
| 232 | auto door = new Doors(d); |
| 233 | entity_list.AddDoor(door); |
| 234 | } |
| 235 | |
| 236 | Object_Struct data = {0}; |
| 237 | uint32 id = 0; |
| 238 | uint32 icon = 0; |
| 239 | uint32 type = 0; |
| 240 | uint32 itemid = 0; |
| 241 | uint32 idx = 0; |
nothing calls this directly
no test coverage detected