This commit is contained in:
aozhiwei 2019-04-29 17:29:45 +08:00
parent 6efaccf258
commit 992141d3d8

View File

@ -292,6 +292,7 @@ void Room::CreateThings()
if (thing_tpl.i->weight() >= rand() % 10000) {
int thing_id = thing_tpl.RandThing();
MetaData::MapThing* thing_meta = MetaMgr::Instance()->GetMapThing(thing_id);
assert(thing_meta);
if (thing_meta) {
if (thing_meta->i->is_house()) {
CreateBuilding(thing_id, thing_tpl.i->x(), thing_tpl.i->y());
@ -424,6 +425,7 @@ Obstacle* Room::CreateObstacle(int id, float x, float y)
[] (Obstacle*)
{
});
assert(entity);
if (entity) {
entity->BroadcastFullState();
}