Page 1 of 1

MOTD logic

Posted: Wed Oct 31, 2007 2:59 pm
by John Adams
I am no expert, and always admit I might have this wrong (grin), but I think this logic check is backwards (since I cannot yet run a self-compiled world, I can only guess).
Problem: My world always says the standard greeting in MOTD, no matter what I put in `variables`.`motd`. I think this is why. In ClientPacketFunctions.cpp, this function appears to check if motd is null or < 1, then print it, else print the std greets.

Code: Select all

void ClientPacketFunctions::SendMOTD ( Client* client )
{	
	char* motd = 0;
	Variable* var = variables.FindVariable("motd");
	if( var == NULL || strlen ( var->GetValue ( ) ) < 1 ){
		motd = var->GetValue();
		client->SimpleMessage(CHANNEL_COLOR_YELLOW, motd);
	}
	else
		client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Message of the Day: Welcome to EQ2Emulator!! Enjoy your stay :)");
}
If motd has text, then it should be displayed. Otherwise, go standard? Do I get a cookie?

Posted: Wed Oct 31, 2007 3:20 pm
by LethalEncounter
lol, yah looks like you are right. I'll fix it. Thanks for the catch! :)

Posted: Sat Nov 03, 2007 6:07 pm
by LethalEncounter
Fixed in latest.