Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t_multi_addon redeed fix #1314

Merged
merged 17 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
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
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