mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
feat(guilds): the Guild Master tells a player already in a guild so
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>
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user