Skip to content

Commit

Permalink
t_multi_addon redeed fix (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
GladieUO authored Dec 3, 2024
1 parent 3faad4d commit 3dccbd7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3945,5 +3945,8 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
This tag does not prevent the player from coming back to life, it just prevents them from respawning on that corpse. The player always comes back to life, but not on that corpse.
- Fixed: If you are around an entity that you own and you are trying to open a bank next to a bank, the "bank" command is perceived as a pet command and the bank does not open. There is no problem when you type "bank" after mounting the mount, but "bank" does not work when you dismount. (Issue #1331)

27-11-2024, Gladie
- Fixed: Redeeding t_multi_addon outside of housing system. Before it was only looking for owner of the multi, but in our case we need to know uid of the redeeding char.
=======
02-11-2024, raydie
- Added: Add LAYER_SPELL_Explosion for use delayed explosion spell. Now if set Duration to spell explosion, these duration is the delay to execute the explosion (From UOGuide, explosion spell: 2 second delay between targetting and explosion)
26 changes: 21 additions & 5 deletions src/game/items/CItemMulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ int16 CItemMulti::GetMultiCount() const
return _iMultiCount;
}

void CItemMulti::Redeed(bool fDisplayMsg, bool fMoveToBank, CUID uidChar)
void CItemMulti::Redeed(bool fDisplayMsg, bool fMoveToBank, CUID uidRedeedingChar)
{
ADDTOCALLSTACK("CItemMulti::Redeed");
if (GetKeyNum("REMOVED") > 0) // Just don't pass from here again, to avoid duplicated deeds.
Expand Down Expand Up @@ -1209,7 +1209,7 @@ void CItemMulti::Redeed(bool fDisplayMsg, bool fMoveToBank, CUID uidChar)
args.m_iN3 = fMoveToBank; // Transfer the Moving Crate to the owner's bank.
if (IsTrigUsed(TRIGGER_REDEED))
{
tRet = OnTrigger(ITRIG_Redeed, uidChar.CharFind(), &args);
tRet = OnTrigger(ITRIG_Redeed, uidRedeedingChar.CharFind(), &args);
if (args.m_iN2 == 0)
{
fMoveToBank = false;
Expand All @@ -1230,7 +1230,8 @@ void CItemMulti::Redeed(bool fDisplayMsg, bool fMoveToBank, CUID uidChar)
}

CChar* pOwner = GetOwner().CharFind();
if (!pOwner || !pOwner->m_pPlayer)
CChar* pChar = uidRedeedingChar.CharFind();
if ((!pChar || !pChar->m_pPlayer) && (!pOwner || !pOwner->m_pPlayer))
{
return;
}
Expand All @@ -1256,11 +1257,26 @@ void CItemMulti::Redeed(bool fDisplayMsg, bool fMoveToBank, CUID uidChar)
}
if (fMoveToBank)
{
pOwner->GetBank(LAYER_BANKBOX)->ContentAdd(pDeed);
if (pOwner)
{
pOwner->GetBank(LAYER_BANKBOX)->ContentAdd(pDeed);
}
else
{
pChar->GetBank(LAYER_BANKBOX)->ContentAdd(pDeed);
}

}
else
{
pOwner->ItemBounce(pDeed, fDisplayMsg);
if (pOwner)
{
pOwner->ItemBounce(pDeed, fDisplayMsg);
}
else
{
pChar->ItemBounce(pDeed, fDisplayMsg);
}
}
}
SetKeyNum("REMOVED", 1);
Expand Down

0 comments on commit 3dccbd7

Please sign in to comment.