diff options
author | Stijn Buys <ingar@osirion.org> | 2012-11-18 16:34:29 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-11-18 16:34:29 +0000 |
commit | 4c45315c9f76bc32e1015a2a2bd9b3ae635023a7 (patch) | |
tree | 3fbfe947a46aabea04d724e29307d40f9292f7f1 /src/core/commandbuffer.cc | |
parent | ab61530779c73e7e145193efcb1e23a47c16e7f3 (diff) |
ADded support for enitty information printing, print current armor values for ships, print death messages
Diffstat (limited to 'src/core/commandbuffer.cc')
-rw-r--r-- | src/core/commandbuffer.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc index 78b76af..53d200f 100644 --- a/src/core/commandbuffer.cc +++ b/src/core/commandbuffer.cc @@ -121,9 +121,20 @@ void func_list_var(std::string const &args) Cvar::list(); } -void func_list_ent(std::string const &args) +void func_list_entity(std::string const &args) { - Entity::list(); + unsigned long id; + std::istringstream argstream(args); + if (argstream >> id) { + Entity *entity = Entity::find(id); + if (entity) { + entity->print(); + } else { + con_print << "Could not find entity with id " << id << std::endl; + } + } else { + Entity::list(); + } } void func_list_inventory(std::string const &args) @@ -133,7 +144,8 @@ void func_list_inventory(std::string const &args) if (argstream >> id) { Entity *entity = Entity::find(id); if (entity) { - entity->list_inventory(); + entity->print_header(); + entity->print_inventory(); } else { con_print << "Could not find entity with id " << id << std::endl; } @@ -269,7 +281,7 @@ void CommandBuffer::init() //con_debug << "Initializing command buffer...\n"; Func *func = 0; - func = Func::add("list_ent", (FuncPtr)func_list_ent); + func = Func::add("list_entity", (FuncPtr)func_list_entity); func->set_info("list entities"); func = Func::add("list_func", (FuncPtr)func_list_func); |