From 47f64f234670f2947f972bdb5d514d8c1e10a7cc Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 14 Oct 2012 21:27:21 +0000 Subject: Improved Jumppoint::validate() warning messages. --- src/game/base/jumppoint.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/game') diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc index 91350c7..eb3d6c2 100644 --- a/src/game/base/jumppoint.cc +++ b/src/game/base/jumppoint.cc @@ -49,13 +49,16 @@ void JumpPoint::validate() { jumppoint_target = 0; + if (targetlabel().size() == 0) + return; + if (targetlabel().size() < 3) { - con_warn << " Jumppoint with invalid target label '" << targetlabel() << "'\n"; + con_warn << " Jumppoint '" << label() << "'with invalid target '" << targetlabel() << "'\n"; return; } size_t pos = targetlabel().find(':'); if ((pos == std::string::npos) || (pos < 1) || (pos >= (targetlabel().size() - 1))) { - con_warn << " Jumppoint with invalid target label '" << targetlabel() << "'\n"; + con_warn << " Jumppoint '" << label() << "'with invalid target '" << targetlabel() << "'\n"; return; } @@ -64,18 +67,18 @@ void JumpPoint::validate() core::Zone *targetzone = core::Zone::find(zonelabel); if (!targetzone) { - con_warn << " Jumppoint with invalid target zone '" << zonelabel << "'\n"; + con_warn << " Jumppoint '" << label() << "'with invalid target zone '" << zonelabel << "'\n"; return; } core::Entity *targetentity = targetzone->find_entity(entitylabel); if (!targetentity) { - con_warn << " Could not find target jumppoint '" << entitylabel << "' in zone '" << zonelabel << "'\n"; + con_warn << " Jumppoint '" << label() << "'with unknown target '" << entitylabel << "' in zone '" << zonelabel << "'\n"; return; } if ((targetentity->moduletype() != jumppoint_enttype) && (targetentity->moduletype() != jumpgate_enttype)) { - con_warn << " Jumppoint with invalid target jumppoint '" << entitylabel << "' in zone '" << zonelabel << "'\n"; + con_warn << " Jumppoint '" << label() << "'with invalid target '" << entitylabel << "' in zone '" << zonelabel << "'\n"; return; } -- cgit v1.2.3