完成building重构
This commit is contained in:
parent
db4126ced0
commit
24cacccbb5
@ -685,32 +685,8 @@ void Player::UpdateDropWeapon()
|
|||||||
{
|
{
|
||||||
Vector2D dir = Vector2D::UP;
|
Vector2D dir = Vector2D::UP;
|
||||||
dir.Rotate(a8::RandAngle());
|
dir.Rotate(a8::RandAngle());
|
||||||
room->CreateLoot(weapon_id, pos + dir * (25 + rand() % 50), 1);
|
room->CreateLoot(weapon_id, pos + dir * (25 + rand() % 50), std::max(1, weapon_ammo));
|
||||||
}
|
}
|
||||||
#if 1
|
|
||||||
{
|
|
||||||
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(weapon_id);
|
|
||||||
if (equip_meta) {
|
|
||||||
Loot* entity = new Loot();
|
|
||||||
entity->room = room;
|
|
||||||
entity->meta = equip_meta;
|
|
||||||
entity->entity_uniid = room->AllocUniid();
|
|
||||||
{
|
|
||||||
Vector2D dir = Vector2D::UP;
|
|
||||||
dir.Rotate(a8::RandAngle());
|
|
||||||
entity->pos = pos + dir * (25 + rand() % 50);
|
|
||||||
}
|
|
||||||
entity->item_id = weapon_id;
|
|
||||||
entity->count = std::max(1, weapon_ammo);
|
|
||||||
entity->Initialize();
|
|
||||||
room->uniid_hash_[entity->entity_uniid] = entity;
|
|
||||||
for (auto& pair : room->human_hash_) {
|
|
||||||
pair.second->new_objects.insert(entity);
|
|
||||||
pair.second->part_objects.insert(entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
for (auto& pair : room->human_hash_) {
|
for (auto& pair : room->human_hash_) {
|
||||||
pair.second->new_objects.insert(this);
|
pair.second->new_objects.insert(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user