MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / OnObjectTileAction

Function OnObjectTileAction

Source/msg.cpp:1507–1522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505}
1506
1507size_t OnObjectTileAction(const TCmd &cmd, Player &player, action_id action, bool pathToObject = true)
1508{
1509 const auto &message = reinterpret_cast<const TCmdLoc &>(cmd);
1510 const Point position { message.x, message.y };
1511 const Object *object = FindObjectAtPosition(position);
1512
1513 if (gbBufferMsgs != 1 && player.isOnActiveLevel() && object != nullptr) {
1514 if (pathToObject)
1515 MakePlrPath(player, position, !object->_oSolidFlag && !object->_oDoorFlag);
1516
1517 player.destAction = action;
1518 player.destParam1 = object->GetId();
1519 }
1520
1521 return sizeof(message);
1522}
1523
1524size_t OnAttackMonster(const TCmd *pCmd, Player &player)
1525{

Callers 1

ParseCmdFunction · 0.85

Calls 4

FindObjectAtPositionFunction · 0.85
MakePlrPathFunction · 0.85
isOnActiveLevelMethod · 0.80
GetIdMethod · 0.80

Tested by

no test coverage detected