fixed buffer not emptying
This commit is contained in:
parent
f257b2d729
commit
244c32ec16
@ -34,14 +34,14 @@ bool RPGModule::messageHandler(Message msg)
|
||||
{
|
||||
QStringList paramList = msg.args.split(' ');
|
||||
if(paramList.size() != 4)
|
||||
answer += privateSay("usage : !rpg register [name of character] [password]", msg.nick);
|
||||
answer = privateSay("usage : !rpg register [name of character] [password]", msg.nick);
|
||||
else
|
||||
{
|
||||
if(charList.get(paramList[2].toStdString()) != NULL)
|
||||
answer += privateSay(QString("ERROR : Character name \"%1\" already exists").arg(paramList[2]), msg.nick);
|
||||
answer = privateSay(QString("ERROR : Character name \"%1\" already exists").arg(paramList[2]), msg.nick);
|
||||
else
|
||||
{
|
||||
answer += privateSay(QString("successfully created the character \"%1\"").arg(paramList[2]), msg.nick);
|
||||
answer = privateSay(QString("successfully created the character \"%1\"").arg(paramList[2]), msg.nick);
|
||||
charList.add(paramList[2].toStdString(), new RPGCharacter(paramList[2], paramList[3]));
|
||||
}
|
||||
}
|
||||
@ -51,17 +51,17 @@ bool RPGModule::messageHandler(Message msg)
|
||||
{
|
||||
QStringList paramList = msg.args.split(' ');
|
||||
if(paramList.size() != 4)
|
||||
answer += privateSay("usage : !rpg join [name of character] [password]", msg.nick);
|
||||
answer = privateSay("usage : !rpg join [name of character] [password]", msg.nick);
|
||||
else
|
||||
{
|
||||
RPGCharacter *c = charList.get(paramList[2].toStdString());
|
||||
if(c != NULL)
|
||||
{
|
||||
playerJoin(getUsers()->getFromNick(msg.nick), c);
|
||||
answer += say(QString("%1 joins the RPG as %2").arg(msg.nick).arg(paramList[2]));
|
||||
answer = say(QString("%1 joins the RPG as %2").arg(msg.nick).arg(paramList[2]));
|
||||
}
|
||||
else
|
||||
answer += privateSay(QString("ERROR : Character name \"%1\" does not exists").arg(paramList[2]), msg.nick);
|
||||
answer = privateSay(QString("ERROR : Character name \"%1\" does not exists").arg(paramList[2]), msg.nick);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user