1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Added initiator-player to packs that add/remove/move objects

This commit is contained in:
Ivan Savenko
2023-09-18 22:09:55 +03:00
parent 3cdc3daa2c
commit 8c0d78f1d9
30 changed files with 152 additions and 115 deletions

View File

@@ -1391,10 +1391,10 @@ void CPlayerInterface::centerView (int3 pos, int focusTime)
CCS->curh->show();
}
void CPlayerInterface::objectRemoved(const CGObjectInstance * obj)
void CPlayerInterface::objectRemoved(const CGObjectInstance * obj, const PlayerColor & initiator)
{
EVENT_HANDLER_CALLED_BY_CLIENT;
if(LOCPLINT->cb->isPlayerMakingTurn(playerID) && obj->getRemovalSound())
if(playerID == initiator && obj->getRemovalSound())
{
waitWhileDialog();
CCS->soundh->playSound(obj->getRemovalSound().value());