fixed 3 major bugs
This commit is contained in:
parent
aa8e420af5
commit
1421f3f166
@ -43,23 +43,6 @@ void RPGModule::initVillages()
|
||||
innkeeperTrader->push_back(t);
|
||||
eventInn.trader = innkeeperTrader;
|
||||
|
||||
v.x = 7;
|
||||
v.y = 4;
|
||||
v.name = "Dornwich";
|
||||
v.events.push_back(eventInn);
|
||||
v.events.push_back(eventBlacksmith);
|
||||
villages.push_back(v);
|
||||
v.x = 1;
|
||||
v.y = 11;
|
||||
v.name = "Dawsbury";
|
||||
v.events.push_back(eventInn);
|
||||
villages.push_back(v);
|
||||
v.x = 17;
|
||||
v.y = 8;
|
||||
v.name = "Willowdale";
|
||||
v.events.push_back(eventInn);
|
||||
v.events.push_back(eventBlacksmith);
|
||||
villages.push_back(v);
|
||||
v.x = 19;
|
||||
v.y = 22;
|
||||
v.name = "Myrefall";
|
||||
@ -68,14 +51,24 @@ void RPGModule::initVillages()
|
||||
v.x = 12;
|
||||
v.y = 15;
|
||||
v.name = "Calmarnock";
|
||||
v.events.push_back(eventInn);
|
||||
villages.push_back(v);
|
||||
v.x = 1;
|
||||
v.y = 11;
|
||||
v.name = "Dawsbury";
|
||||
villages.push_back(v);
|
||||
v.x = 3;
|
||||
v.y = 18;
|
||||
v.name = "Waeldestone";
|
||||
v.events.push_back(eventInn);
|
||||
v.events.push_back(eventBlacksmith);
|
||||
villages.push_back(v);
|
||||
v.x = 7;
|
||||
v.y = 4;
|
||||
v.name = "Dornwich";
|
||||
villages.push_back(v);
|
||||
v.x = 17;
|
||||
v.y = 8;
|
||||
v.name = "Willowdale";
|
||||
villages.push_back(v);
|
||||
}
|
||||
|
||||
bool RPGCharacter::fromString(QString str)
|
||||
@ -216,13 +209,13 @@ QString RPGModule::lookAt(RPGCharacter *c, QString target)
|
||||
return QString("%1 is in %2").arg(c->pseudo).arg(getTerrainName(terrain));
|
||||
}
|
||||
else if(target.compare("north") == 0 || target.compare("n") == 0)
|
||||
return QString("%1 looks north and sees %2").arg(c->pseudo).arg(getTerrainName(WORLDMAP[c->y-1][c->x]));
|
||||
return QString("%1 looks north and sees %2").arg(c->pseudo).arg(c->y > 0 ? getTerrainName(WORLDMAP[c->y-1][c->x]) : "a hill");
|
||||
else if(target.compare("south") == 0 || target.compare("s") == 0)
|
||||
return QString("%1 looks south and sees %2").arg(c->pseudo).arg(getTerrainName(WORLDMAP[c->y+1][c->x]));
|
||||
return QString("%1 looks south and sees %2").arg(c->pseudo).arg(c->y < 24 ? getTerrainName(WORLDMAP[c->y+1][c->x]) : "a hill");
|
||||
else if(target.compare("west") == 0 || target.compare("w") == 0)
|
||||
return QString("%1 looks west and sees %2").arg(c->pseudo).arg(getTerrainName(WORLDMAP[c->y][c->x-1]));
|
||||
return QString("%1 looks west and sees %2").arg(c->pseudo).arg(c->x > 0 ? getTerrainName(WORLDMAP[c->y][c->x-1]) : "a hill");
|
||||
else if(target.compare("east") == 0 || target.compare("e") == 0)
|
||||
return QString("%1 looks east and sees %2").arg(c->pseudo).arg(getTerrainName(WORLDMAP[c->y][c->x+1]));
|
||||
return QString("%1 looks east and sees %2").arg(c->pseudo).arg(c->x < 24 ? getTerrainName(WORLDMAP[c->y][c->x+1]) : "a hill");
|
||||
else
|
||||
return QString("%1 is not a valid target").arg(target);
|
||||
}
|
||||
@ -370,8 +363,14 @@ bool RPGModule::messageHandler(Message msg)
|
||||
{
|
||||
if(c->password.compare(paramList[3]) == 0)
|
||||
{
|
||||
playerJoin(getUsers()->getFromNick(msg.nick), c);
|
||||
answer = say(QString("%1 joins the RPG as %2").arg(msg.nick).arg(paramList[2]));
|
||||
User *u = getUsers()->getFromNick(msg.nick);
|
||||
if(u != NULL)
|
||||
{
|
||||
playerJoin(u, c);
|
||||
answer = say(QString("%1 joins the RPG as %2").arg(msg.nick).arg(paramList[2]));
|
||||
}
|
||||
else
|
||||
answer = privateSay(QString("ERROR : You must be connected to the #epicsparrow chan"), msg.nick);
|
||||
}
|
||||
else
|
||||
answer = privateSay(QString("ERROR : Wrong password"), msg.nick);
|
||||
|
Loading…
x
Reference in New Issue
Block a user