diff options
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r-- | src/core/entity.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index aa9e45b..baefcea 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -204,6 +204,10 @@ void Entity::clear_updates() void Entity::set_info(Info *info) { entity_info = info; + if (entity_info) { + entity_info->set_model(model()); + entity_info->set_name(name()); + } } void Entity::set_inventory(Inventory *inventory) @@ -237,7 +241,13 @@ void Entity::set_model(model::Model *model) entity_model = model; if (entity_model) { entity_radius = entity_model->radius(); - entity_modelname = entity_model->name(); + entity_modelname.assign(entity_model->name()); + } else { + entity_modelname.clear(); + } + + if (entity_info) { + entity_info->set_model(entity_model); } } |