mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
chore(PlayerScript/Hook) : Add CanSetTradeItem Hook in PlayerScript (#18583)
* chore(PlayerScript/Hook) : Add CanSetTradeItem Hook in PlayerScript * Allowing non traded slots * Fix typo and codestyle
This commit is contained in:
@@ -1508,6 +1508,19 @@ bool ScriptMgr::CanInitTrade(Player* player, Player* target)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanSetTradeItem(Player* player, Item* tradedItem, uint8 tradeSlot)
|
||||
{
|
||||
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
|
||||
{
|
||||
return !script->CanSetTradeItem(player, tradedItem, tradeSlot);
|
||||
});
|
||||
|
||||
if (ret && *ret)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnSetServerSideVisibility(Player* player, ServerSideVisibilityType& type, AccountTypes& sec)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
|
||||
Reference in New Issue
Block a user