revert SendShowBook to fix /spawn details and other use of the book pages
This commit is contained in:
parent
fd147a0fd0
commit
61aec683b5
@ -767,7 +767,7 @@ void Commands::Command_Bot_Help(Client* client, Seperator* sep) {
|
|||||||
details += "18\tSarnak\n";
|
details += "18\tSarnak\n";
|
||||||
details += "19\tVampire\n";
|
details += "19\tVampire\n";
|
||||||
details += "20\tAerakyn\n";
|
details += "20\tAerakyn\n";
|
||||||
client->SendShowBook(client->GetPlayer(), title, 0, 1, details.c_str());
|
client->SendShowBook(client->GetPlayer(), title, 0, 1, details);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (strncasecmp("class", sep->arg[0], 5) == 0) {
|
else if (strncasecmp("class", sep->arg[0], 5) == 0) {
|
||||||
@ -822,7 +822,7 @@ void Commands::Command_Bot_Help(Client* client, Seperator* sep) {
|
|||||||
details3 += "43\tSHAPER\n";
|
details3 += "43\tSHAPER\n";
|
||||||
details3 += "44\tCHANNELER\n";
|
details3 += "44\tCHANNELER\n";
|
||||||
|
|
||||||
client->SendShowBook(client->GetPlayer(), title, 0, 3, details.c_str(), details2.c_str(), details3.c_str());
|
client->SendShowBook(client->GetPlayer(), title, 0, 3, details, details2, details3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4974,7 +4974,7 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
|
|||||||
details4 += "\nSpawnScript: " + std::string(spawnScriptMsg) + "\n";
|
details4 += "\nSpawnScript: " + std::string(spawnScriptMsg) + "\n";
|
||||||
|
|
||||||
string title = string(spawn->GetName()) + "(" + to_string(spawn->GetDatabaseID()) + ")";
|
string title = string(spawn->GetName()) + "(" + to_string(spawn->GetDatabaseID()) + ")";
|
||||||
client->SendShowBook(client->GetPlayer(), title, 0, 4, details.c_str(), details2.c_str(), details3.c_str(), details4.c_str());
|
client->SendShowBook(client->GetPlayer(), title, 0, 4, details, details2, details3, details4);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn details (radius)");
|
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn details (radius)");
|
||||||
|
@ -12339,7 +12339,7 @@ void Client::SendShowBook(Spawn* sender, string title, int8 language, int8 num_p
|
|||||||
{
|
{
|
||||||
if (!sender)
|
if (!sender)
|
||||||
{
|
{
|
||||||
LogWrite(CCLIENT__ERROR, 0, "Client", "SendShowBook missing sender for Player %s, book title %s", GetPlayer()->GetName(), title.c_str());
|
LogWrite(CCLIENT__ERROR, 0, "Client", "SendShowBook missing sender for Player %s, book title %s", GetPlayer()->GetName(), title);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12365,14 +12365,14 @@ void Client::SendShowBook(Spawn* sender, string title, int8 language, int8 num_p
|
|||||||
std::string endString("");
|
std::string endString("");
|
||||||
for (int8 p = 0; p < num_pages; p++)
|
for (int8 p = 0; p < num_pages; p++)
|
||||||
{
|
{
|
||||||
const char* pageChars = va_arg(args, const char*);
|
std::string page = va_arg(args, string);
|
||||||
switch (GetVersion())
|
switch (GetVersion())
|
||||||
{
|
{
|
||||||
// release client
|
// release client
|
||||||
case 283:
|
case 283:
|
||||||
case 373: // trial isle client
|
case 373: // trial isle client
|
||||||
{
|
{
|
||||||
endString.append(pageChars);
|
endString.append(page);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// DoF trial
|
// DoF trial
|
||||||
@ -12380,15 +12380,15 @@ void Client::SendShowBook(Spawn* sender, string title, int8 language, int8 num_p
|
|||||||
case 561:
|
case 561:
|
||||||
{
|
{
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
packet->setDataByName("cover_page", pageChars);
|
packet->setDataByName("cover_page", page.c_str());
|
||||||
else
|
else
|
||||||
packet->setArrayDataByName("page_text", pageChars, p - 1);
|
packet->setArrayDataByName("page_text", page.c_str(), p - 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// all other clients
|
// all other clients
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
packet->setArrayDataByName("page_text", pageChars, p);
|
packet->setArrayDataByName("page_text", page.c_str(), p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -12409,7 +12409,7 @@ void Client::SendShowBook(Spawn* sender, string title, int8 language, vector<Ite
|
|||||||
{
|
{
|
||||||
if (!sender)
|
if (!sender)
|
||||||
{
|
{
|
||||||
LogWrite(CCLIENT__ERROR, 0, "Client", "SendShowBook missing sender for Player %s, book title %s", GetPlayer()->GetName(), title.c_str());
|
LogWrite(CCLIENT__ERROR, 0, "Client", "SendShowBook missing sender for Player %s, book title %s", GetPlayer()->GetName(), title);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user