MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / VehicleAddRef

Method VehicleAddRef

engine/Poseidon/World/Simulation/Simul.cpp:289–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void 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
320void EntityType::VehicleRelease() const
321{

Callers 8

EntityMethod · 0.80
ForestMethod · 0.80
NewObjectFunction · 0.80
NewShotFunction · 0.80
InitShapeMethod · 0.80
NewVehicleFunction · 0.80
NewNonAIVehicleQuietFunction · 0.80
ObjectTypedMethod · 0.80

Calls 5

SetAutoCenterMethod · 0.80
AllowAnimationMethod · 0.80
NewMethod · 0.45
InitShapeMethod · 0.45

Tested by

no test coverage detected