| 287 | } |
| 288 | |
| 289 | void EntityType::VehicleAddRef() const |
| 290 | { |
| 291 | if (_refVehicles++ == 0) |
| 292 | { |
| 293 | if (_shapeName[0]) |
| 294 | { |
| 295 | bool shadow = true; |
| 296 | _shape = Shapes.New(_shapeName, _shapeReversed, shadow); |
| 297 | if (!_shape) |
| 298 | { |
| 299 | LOG_ERROR(World, "Cannot load vehicle shape '{}'", (const char*)_shapeName); |
| 300 | return; |
| 301 | } |
| 302 | if (!_shapeAutoCentered) |
| 303 | { |
| 304 | _shape->SetAutoCenter(false); |
| 305 | _shape->CalculateBoundingSphere(); |
| 306 | } |
| 307 | const_cast<EntityType*>(this)->InitShape(); |
| 308 | if (_shapeAnimated) |
| 309 | { |
| 310 | _shape->AllowAnimation(); |
| 311 | } |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | const_cast<EntityType*>(this)->InitShape(); |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | void EntityType::VehicleRelease() const |
| 321 | { |
no test coverage detected