Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,16 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Object* source = findObjectByID(sourceID);
if (source != nullptr)
{
// TheSuperHackers @fix stephanmeesters 01/03/2026 Validate the origin of the source object
if ( source->getControllingPlayer() != thisPlayer )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thought on this: This would cause mismatch if someone cheated, for example with Control Hack. Are we ok with this?

It probably needs to go behind RETAIL_COMPATIBLE_CRC for the upmost correctness

Copy link
Author

@stephanmeesters stephanmeesters Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO mismatch is desirable here, and would be nice if the first release can have all these cases solid so it's a more "trustworthy" client (although, it doesn't actually communicate around that it did a good thing..)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to go that route, then at least put a commented // #if RETAIL_COMPATIBLE_CRC and explain why we accept this mismatch.

{
DEBUG_CRASH( ("MSG_DO_SPECIAL_POWER: Player '%ls' attempted to control the object '%s' owned by player '%ls'.",
thisPlayer->getPlayerDisplayName().str(),
source->getTemplate()->getName().str(),
source->getControllingPlayer()->getPlayerDisplayName().str()) );
break;
}

AIGroupPtr theGroup = TheAI->createGroup();
theGroup->add(source);
theGroup->groupDoSpecialPower( specialPowerID, options );
Expand Down Expand Up @@ -725,6 +735,16 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Object* source = findObjectByID(sourceID);
if (source != nullptr)
{
// TheSuperHackers @fix stephanmeesters 01/03/2026 Validate the origin of the source object
if ( source->getControllingPlayer() != thisPlayer )
{
DEBUG_CRASH( ("MSG_DO_SPECIAL_POWER_AT_LOCATION: Player '%ls' attempted to control the object '%s' owned by player '%ls'.",
thisPlayer->getPlayerDisplayName().str(),
source->getTemplate()->getName().str(),
source->getControllingPlayer()->getPlayerDisplayName().str()) );
break;
}

AIGroupPtr theGroup = TheAI->createGroup();
theGroup->add(source);
theGroup->groupDoSpecialPowerAtLocation( specialPowerID, &targetCoord, angle, objectInWay, options );
Expand Down Expand Up @@ -768,6 +788,16 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Object* source = findObjectByID(sourceID);
if (source != nullptr)
{
// TheSuperHackers @fix stephanmeesters 01/03/2026 Validate the origin of the source object
if ( source->getControllingPlayer() != thisPlayer )
{
DEBUG_CRASH( ("MSG_DO_SPECIAL_POWER_AT_OBJECT: Player '%ls' attempted to control the object '%s' owned by player '%ls'.",
thisPlayer->getPlayerDisplayName().str(),
source->getTemplate()->getName().str(),
source->getControllingPlayer()->getPlayerDisplayName().str()) );
break;
}

AIGroupPtr theGroup = TheAI->createGroup();
theGroup->add(source);
theGroup->groupDoSpecialPowerAtObject( specialPowerID, target, options );
Expand Down Expand Up @@ -1211,6 +1241,16 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Object* source = findObjectByID(sourceID);
if (source != nullptr)
{
// TheSuperHackers @fix stephanmeesters 01/03/2026 Validate the origin of the source object
if ( source->getControllingPlayer() != thisPlayer )
{
DEBUG_CRASH( ("MSG_DO_SPECIAL_POWER_OVERRIDE_DESTINATION: Player '%ls' attempted to control the object '%s' owned by player '%ls'.",
thisPlayer->getPlayerDisplayName().str(),
source->getTemplate()->getName().str(),
source->getControllingPlayer()->getPlayerDisplayName().str()) );
break;
}

AIGroupPtr theGroup = TheAI->createGroup();
theGroup->add(source);
theGroup->groupOverrideSpecialPowerDestination( spType, loc, CMD_FROM_PLAYER );
Expand Down
Loading