From: <ma...@us...> - 2012-01-07 16:32:01
|
Revision: 7982 http://planeshift.svn.sourceforge.net/planeshift/?rev=7982&view=rev Author: magodra Date: 2012-01-07 16:31:55 +0000 (Sat, 07 Jan 2012) Log Message: ----------- - Added display of values for reactions in the /info output. This will show usefull info for time events. Modified Paths: -------------- trunk/src/npcclient/npcbehave.cpp Modified: trunk/src/npcclient/npcbehave.cpp =================================================================== --- trunk/src/npcclient/npcbehave.cpp 2012-01-07 16:28:52 UTC (rev 7981) +++ trunk/src/npcclient/npcbehave.cpp 2012-01-07 16:31:55 UTC (rev 7982) @@ -407,23 +407,30 @@ csString NPCType::InfoReactions(NPC *npc) { csString reply; - const char* delim = ", "; for (size_t i=0; i<reactions.GetSize(); i++) { - if (i == (reactions.GetSize()-1)) + + reply.AppendFmt("%s",reactions[i]->GetEventType(npc).GetDataSafe()); + + if (!reactions[i]->GetType().IsEmpty()) { - delim = "."; + reply.AppendFmt("[%s]",reactions[i]->GetType().GetDataSafe()); } - - if (reactions[i]->GetType().IsEmpty()) + if (!reactions[i]->GetValue().IsEmpty()) { - reply.AppendFmt("%s%s",reactions[i]->GetEventType(npc).GetDataSafe(),delim); + reply.AppendFmt("(%s)",reactions[i]->GetValue().GetDataSafe()); } + + if (i == (reactions.GetSize()-1)) + { + reply.Append("."); + } else { - reply.AppendFmt("%s[%s]%s",reactions[i]->GetEventType(npc).GetDataSafe(),reactions[i]->GetType().GetDataSafe(),delim); + reply.Append(", "); } + } return reply; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |