mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 08:45:27 +00:00
fix: a player's own messages have to be sent for that player
The die request, the smash request, the loaded notice, chat commands and the racing pickup notice were handled for whichever object they named. They are now only handled for the player that sent them, or for the vehicle that player drives where the client sends them for it. A racing pickup also has to be an object of a race track that is not a player, a vehicle or the zone's own object. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "PlayerMessages.h"
|
||||
|
||||
#include "Logger.h"
|
||||
#include "BitStreamUtils.h"
|
||||
#include "Character.h"
|
||||
#include "CharacterComponent.h"
|
||||
@@ -190,6 +191,11 @@ namespace GameMessages {
|
||||
}
|
||||
|
||||
void ParseChatMessage::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
||||
// A chat command runs for the player that typed it
|
||||
if (!entity.IsPlayer() || entity.GetSystemAddress() != sysAddr) {
|
||||
LOG("Object %llu (LOT %i) is not the player that sent a chat command for it", entity.GetObjectID(), entity.GetLOT());
|
||||
return;
|
||||
}
|
||||
if (!wsString.empty() && wsString[0] == L'/') {
|
||||
SlashCommandHandler::HandleChatCommand(wsString, &entity, sysAddr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user