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

Method SpawnBackpack

PanzerChasm/server/map.cpp:374–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374void Map::SpawnBackpack( BackpackPtr backpack )
375{
376 const EntityId id= next_rocket_id_;
377 next_rocket_id_++;
378
379 Backpack& inserted_backpack=
380 *backpacks_.emplace( id, std::move(backpack) ).first->second;
381
382 inserted_backpack.min_z= GetFloorLevel( inserted_backpack.pos.xy(), 0.2f/* TODO - select correct radius*/ );
383
384 // Let backpacks jump up after spawn.
385 inserted_backpack.vertical_speed= GameConstants::vertical_acceleration * -0.2f;
386
387 dynamic_items_birth_messages_.emplace_back();
388 PrepareBackpackBirthMessage( inserted_backpack, id, dynamic_items_birth_messages_.back() );
389}
390
391void Map::SpawnMonsterBodyPart(
392 const unsigned char monster_type_id, const unsigned char body_part_id,

Callers 1

HitMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected