fix: check for the player before handling the messages a player sends

Several messages used the player, the character or the user they named
without checking that there is one. A match request and a trade request
are now only handled for the player that sent them, a linked mission
request and a build mode change only for the sending player, and the
remaining handlers return when the player, character or user is
missing.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 13:08:57 -06:00
parent 0f1bce32fb
commit 718bd78e8c
6 changed files with 30 additions and 5 deletions

View File

@@ -136,6 +136,11 @@ namespace GameMessages {
}
void MatchRequest::Handle(Entity& entity, const SystemAddress& sysAddr) {
// A player asks for their own match
if (!entity.IsPlayer() || entity.GetSystemAddress() != sysAddr) {
LOG("Object %llu (LOT %i) is not the player that sent a match request for it", entity.GetObjectID(), entity.GetLOT());
return;
}
std::vector<Entity*> scriptedActs = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::SCRIPTED_ACTIVITY);
if (type == 0) { // join
if (value != 0) {