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

Method ProcessWind

PanzerChasm/server/map.cpp:2514–2537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2512}
2513
2514void Map::ProcessWind( const MapData::Procedure::ActionCommand& command, bool activate )
2515{
2516 PC_ASSERT( command.id == MapData::Procedure::ActionCommandId::Wind );
2517
2518 const unsigned int x0= static_cast<unsigned int>( command.args[0] );
2519 const unsigned int y0= static_cast<unsigned int>( command.args[1] );
2520 const unsigned int x1= static_cast<unsigned int>( command.args[2] );
2521 const unsigned int y1= static_cast<unsigned int>( command.args[3] );
2522 const int dir_x= static_cast<int>( command.args[4] );
2523 const int dir_y= static_cast<int>( command.args[5] );
2524
2525 for( unsigned int y= y0; y <= y1 && y < MapData::c_map_size; y++ )
2526 for( unsigned int x= x0; x <= x1 && x < MapData::c_map_size; x++ )
2527 {
2528 char* const cell= wind_field_[ x + y * MapData::c_map_size ];
2529 if( activate )
2530 {
2531 cell[0]= dir_x;
2532 cell[1]= dir_y;
2533 }
2534 else
2535 cell[0]= cell[1]= 0;
2536 }
2537}
2538
2539void Map::ProcessDeathZone( const MapData::Procedure::ActionCommand& command, const bool activate )
2540{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected