mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 19:03:43 +00:00
Instead of opening the create box, a player with a guild gets "You are already in a guild!" in system chat, the client's own MSG_GUILD_ALREADY_IN_GUILD text (which the client shows only once the box is submitted). Check: use the Guild Master (LOT 3001) with and without a guild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
816 B
C++
22 lines
816 B
C++
#include "FvGuildCreate.h"
|
|
|
|
#include "CharacterComponent.h"
|
|
#include "ChatPackets.h"
|
|
#include "Entity.h"
|
|
#include "PlayerMessages.h"
|
|
|
|
void FvGuildCreate::OnUse(Entity* self, Entity* user) {
|
|
// A player already in a guild is told so instead of getting the create box. The client itself says the same
|
|
// (MSG_GUILD_ALREADY_IN_GUILD, system chat) only once the box is submitted (LWOGuildComponent::SendTMPGuildCreate).
|
|
const auto* characterComponent = user->GetComponent<CharacterComponent>();
|
|
if (characterComponent && characterComponent->GetGuildID() != LWOOBJID_EMPTY) {
|
|
ChatPackets::SendSystemMessage(user->GetSystemAddress(), u"You are already in a guild!");
|
|
return;
|
|
}
|
|
|
|
GameMessages::DisplayGuildCreateBox box;
|
|
box.target = user->GetObjectID();
|
|
box.bShow = true;
|
|
box.Send(user->GetSystemAddress());
|
|
}
|