Repository navigation
MSG_DO_WEAPON_AT_LOCATION sends unused ObjectID argument. #3410
Copy link
Copy link
Open
Description
Here's all 3 location it sends extra argument:
GeneralsGameCode/Core/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp
Lines 147 to 156 in 5ae042c
| // create the message and append arguments | |
| msg = TheMessageStream->appendMessage( GameMessage::MSG_DO_WEAPON_AT_LOCATION ); | |
| msg->appendIntegerArgument( command->getWeaponSlot() ); | |
| msg->appendLocationArgument( world ); | |
| msg->appendIntegerArgument( command->getMaxShotsToFire() ); | |
| //Also append the object ID (incase weapon doesn't like obstacles on land). | |
| Object *target = validUnderCursor( mouse, command, PICK_TYPE_SELECTABLE ); | |
| ObjectID targetID = target ? target->getID() : INVALID_ID; | |
| msg->appendObjectIDArgument( targetID ); |
GeneralsGameCode/Core/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
Lines 1341 to 1353 in 6e21c94
| //Actually, you know what.... we want to attack the object's location instead. | |
| msgType = GameMessage::MSG_DO_WEAPON_AT_LOCATION; | |
| if( commandType == DO_COMMAND ) | |
| { | |
| GameMessage *msg; | |
| msg = TheMessageStream->appendMessage( msgType ); | |
| msg->appendIntegerArgument( command->getWeaponSlot() ); | |
| msg->appendLocationArgument( *pos ); | |
| msg->appendIntegerArgument( command->getMaxShotsToFire() ); | |
| //Object in way.... some location weapons care, others don't | |
| ObjectID targetID = (target && target->getObject()) ? target->getObject()->getID() : INVALID_ID; | |
| msg->appendObjectIDArgument( targetID ); | |
| } |
GeneralsGameCode/Core/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
Lines 1377 to 1389 in 6e21c94
| //LOCATION BASED FIRE WEAPON | |
| msgType = GameMessage::MSG_DO_WEAPON_AT_LOCATION; | |
| if( commandType == DO_COMMAND ) | |
| { | |
| GameMessage *msg; | |
| msg = TheMessageStream->appendMessage( msgType ); | |
| msg->appendIntegerArgument( command->getWeaponSlot() ); | |
| msg->appendLocationArgument( *pos ); | |
| msg->appendIntegerArgument( command->getMaxShotsToFire() ); | |
| //Object in way.... some location weapons care, others don't | |
| ObjectID targetID = (target && target->getObject()) ? target->getObject()->getID() : INVALID_ID; | |
| msg->appendObjectIDArgument( targetID ); | |
| } |
Where the message is processed:
GeneralsGameCode/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
Lines 1111 to 1126 in 1e39288
| bool GameLogic::onDoWeaponAtLocation(MAYBE_UNUSED GameMessage *msg, AIGroupPtr ¤tlySelectedGroup) | |
| { | |
| WeaponSlotType weaponSlot = (WeaponSlotType)msg->getArgument( 0 )->integer; | |
| Coord3D targetLoc = msg->getArgument( 1 )->location; | |
| Int maxShotsToFire = msg->getArgument( 2 )->integer; | |
| // issue command for either single object or for selected group | |
| if( currentlySelectedGroup ) | |
| { | |
| // lock it just till the weapon is empty or the attack is "done" | |
| if (currentlySelectedGroup->setWeaponLockForGroup( weaponSlot, LOCKED_TEMPORARILY )) | |
| currentlySelectedGroup->groupAttackPosition( &targetLoc, maxShotsToFire, CMD_FROM_PLAYER ); | |
| } | |
| return true; | |
| } |
Looks harmless.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Caball009 commentedon Oct 3, 2026
Similar to #2762.