From 12834c9dc3c119dc3cf45ba141d9a90fb4f95075 Mon Sep 17 00:00:00 2001
From: Stijn Buys <ingar@osirion.org>
Date: Thu, 25 Dec 2014 21:53:49 +0000
Subject: Corrected a number of imperfections in Entity::print(),
 EntityDynamic::print() and Info::print().

---
 src/core/entity.cc | 45 +++++++++++++++++++++++----------------------
 src/core/info.cc   |  2 +-
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/src/core/entity.cc b/src/core/entity.cc
index 41ead7e..f7501f7 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -296,9 +296,12 @@ void Entity::print() const
 	// game module type id
 	con_print << "  ^Nmodule type ^B" << moduletype() << std::endl;
 	
-	// print entity flags
+	// entity flags
 	con_print << "  ^Nflags      ^B";
 	if (flags() == 0)
+	{
+		con_print << " ^Bnone";
+	} else
 	{
 		if (has_flag(NonSolid)) {
 			con_print << " ^Bnonsolid";
@@ -315,11 +318,8 @@ void Entity::print() const
 		if (has_flag(KeepAlive)) {
 			con_print << " ^Bkeepalive";
 		}
-	} else
-	{
-		con_print << " ^Bnone";
 	}
-	con_print << std::endl;	
+	con_print << std::endl;
 
 	// level
 	con_print << "  ^Nlevel       ^B" << level() << std::endl;
@@ -340,25 +340,25 @@ void Entity::print() const
 		con_print << "  ^Nmodel       ^B" << model()->name() << std::endl;
 	} else
 	{
-		con_print << "  ^Nshape       ^B";
+		con_print << "  ^Nshape       ";
 		switch (shape())
 		{
 			case Diamond:
-				con_print << "diamond";
+				con_print << "^Bdiamond";
 				break;
 			case Sphere:
-				con_print << "sphere";
+				con_print << "^Bsphere";
 				break;
 			case Cube:
-				con_print << "cube";
+				con_print << "^Bcube";
 				break;
 			case Axis:
-				con_print << "axis";
+				con_print << "^Baxis";
 				break;
 		}
+		con_print << std::endl;
 	}
 	
-
 	// slots
 	if (slots() && slots()->size()) {
 		int nbcannons = 0;
@@ -394,7 +394,7 @@ void Entity::print() const
 		con_print <<  std::endl;
 	}
 	
-	// invenotry
+	// inventiry
 	if (inventory()) {
 		print_inventory();
 	}
@@ -883,38 +883,39 @@ void EntityDynamic::print() const
 	Entity::print();
 	
 	con_print << "  ^Nstate       ^B";
-	switch (state()) {
+	switch (state())
+	{
 		case Normal:
-			con_print << "normal";
+			con_print << "^Bnormal";
 			break;
 
 		case NoPower:
-			con_print << "nopower";
+			con_print << "^Bnopower";
 			break;
 			
 		case ImpulseInitiate:
-			con_print << "impulseinitiate";
+			con_print << "^Bimpulseinitiate";
 			break;
 			
 		case Impulse:
-			con_print << "impulse";
+			con_print << "^Bimpulse";
 			break;
 			
 		case JumpInitiate:
-			con_print << "jumpinitiate";
+			con_print << "^Bjumpinitiate";
 			break;
 			
 		case Jump:
-			con_print << "jump";
+			con_print << "^Bjump";
 			break;
 			
 		case Docked:
-			con_print << "docked";
+			con_print << "^Bdocked";
 			break;
 			
 		case Destroyed:
-			con_print << "destroyed";
-			break;			
+			con_print << "^Bdestroyed";
+			break;
 	}
 	con_print << std::endl;
 }
diff --git a/src/core/info.cc b/src/core/info.cc
index 3d1b6cc..0f48eab 100644
--- a/src/core/info.cc
+++ b/src/core/info.cc
@@ -253,7 +253,7 @@ void Info::receive_server_update(std::istream &is)
 
 void Info::print() const
 {
-	con_print << "  id: ^B" << std::setw(4) << std::setfill(' ') << id() << " type: ^B" << (type() ? type()->label() : "NULL") << " ^Nlabel: ^B" << label() << " ^Nname: ^B" << name() << " ^Nmodel: ^B" << modelname() << "^N" << std::endl;
+	con_print << "  ^Ninfo id ^B" << std::setw(4) << std::setfill(' ') << id() << " ^Ntype ^B" << (type() ? type()->label() : "NULL") << " ^Nlabel ^B" << label() << " ^Nname ^B" << name() << " ^Nmodel ^B" << modelname() << "^N" << std::endl;
 	if (info_text.size()) {
 		for (Text::const_iterator it = info_text.begin(); it != info_text.end(); it++) {
 			con_print << "  " << (*it) << std::endl;
-- 
cgit v1.2.3