1
This commit is contained in:
parent
7d070ea9f5
commit
dbf0d5e8f8
@ -270,26 +270,9 @@ void Room::ScatterDrop(Vector2D center, int drop_id)
|
||||
std::vector<std::tuple<int, int>> drop_items;
|
||||
drop_meta->RandItems(drop_items);
|
||||
for (auto& item : drop_items) {
|
||||
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(std::get<0>(item));
|
||||
if (equip_meta) {
|
||||
Loot* entity = new Loot();
|
||||
entity->room = this;
|
||||
entity->meta = equip_meta;
|
||||
entity->entity_uniid = AllocUniid();
|
||||
{
|
||||
Vector2D dir = Vector2D::UP;
|
||||
dir.Rotate(a8::RandAngle());
|
||||
entity->pos = center + dir * (5 + rand() % 50);
|
||||
}
|
||||
entity->item_id = std::get<0>(item);
|
||||
entity->count = std::get<1>(item);
|
||||
entity->Initialize();
|
||||
uniid_hash_[entity->entity_uniid] = entity;
|
||||
for (auto& pair : human_hash_) {
|
||||
pair.second->new_objects.insert(entity);
|
||||
pair.second->part_objects.insert(entity);
|
||||
}
|
||||
}
|
||||
DropItem(center + dir * (5 + rand() % 50), std::get<0>(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user