Page 1 of 1

Guilds - Bug of the Day

Posted: Mon Apr 04, 2011 10:26 am
by John Adams
Scatoooo, I cannot figure this one out. The SQL inserts look fine, yet the date appears to have slid?

Code: Select all

void WorldDatabase::SaveGuild(Guild* guild, bool new_guild) {
	if (guild) {
		Query query;
		if (new_guild) {
			query.RunQuery2(Q_INSERT, "INSERT INTO `guilds` (`name`, `motd`, `level`, `xp`, `xp_needed`, `formed_on`) VALUES ('%s', '%s', %u, %u, %u, %u)", getSafeEscapeString(guild->GetName()).c_str(), getSafeEscapeString(guild->GetMOTD()).c_str(), guild->GetLevel(), guild->GetEXPCurrent(), guild->GetEXPToNextLevel(), guild->GetFormedDate());
			guild->SetID(query.GetLastInsertedID());
		}
		else
			query.RunQuery2(Q_UPDATE, "UPDATE `guilds` SET `name`='%s', `motd`='%s', `level`=%u, `xp`=%u, `xp_needed`=%u, `formed_on`=%u WHERE `id`=%u", getSafeEscapeString(guild->GetName()).c_str(), getSafeEscapeString(guild->GetMOTD()).c_str(), guild->GetLevel(), guild->GetEXPCurrent(), guild->GetEXPToNextLevel(), guild->GetFormedDate(), guild->GetID());
		guild->SetSaveNeeded(false);
	}
}
guildformedon.jpg
Results in bad date value for Formed On.


I am at work, and cannot debug this now. Just posting it as a bug.