MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / DestroyModel

Method DestroyModel

PanzerChasm/server/map.cpp:2566–2584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2564}
2565
2566void Map::DestroyModel( const unsigned int model_index )
2567{
2568 PC_ASSERT( model_index < static_models_.size() );
2569 StaticModel& model= static_models_[ model_index ];
2570
2571 EmitModelDestructionEffects( model_index );
2572
2573 model.model_id++; // now, this model has other model type
2574
2575 // Reset animation. Animation must be consistent with model.
2576 model.animation_start_frame= 0u;
2577 model.current_animation_frame= 0u;
2578 model.animation_state= StaticModel::AnimationState::Animation;
2579
2580 if( model.model_id < map_data_->models_description.size() )
2581 model.health= map_data_->models_description[ model.model_id ].break_limit;
2582 else
2583 model.health= 0;
2584}
2585
2586void Map::DoExplosionDamage(
2587 const m_Vec3& explosion_center,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected