mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9204] Move remaining handling of GO from SendLoot to GameObject::Use
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
f7de2ce1d7
commit
16c0ff3ef7
3 changed files with 25 additions and 14 deletions
|
|
@ -892,6 +892,24 @@ void GameObject::Use(Unit* user)
|
||||||
player->SendPreparedGossip(this);
|
player->SendPreparedGossip(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case GAMEOBJECT_TYPE_CHEST:
|
||||||
|
{
|
||||||
|
if (user->GetTypeId() != TYPEID_PLAYER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO: possible must be moved to loot release (in different from linked triggering)
|
||||||
|
if (GetGOInfo()->chest.eventId)
|
||||||
|
{
|
||||||
|
sLog.outDebug("Chest ScriptStart id %u for GO %u", GetGOInfo()->chest.eventId, GetDBTableGUIDLow());
|
||||||
|
GetMap()->ScriptsStart(sEventScripts, GetGOInfo()->chest.eventId, user, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// triggering linked GO
|
||||||
|
if (uint32 trapEntry = GetGOInfo()->chest.linkedTrapId)
|
||||||
|
TriggeringLinkedGameObject(trapEntry, user);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
case GAMEOBJECT_TYPE_CHAIR: //7 Sitting: Wooden bench, chairs
|
case GAMEOBJECT_TYPE_CHAIR: //7 Sitting: Wooden bench, chairs
|
||||||
{
|
{
|
||||||
GameObjectInfo const* info = GetGOInfo();
|
GameObjectInfo const* info = GetGOInfo();
|
||||||
|
|
@ -1311,7 +1329,7 @@ void GameObject::Use(Unit* user)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
sLog.outDebug("GameObject::Use unhandled GameObject type %u (entry %u).", GetGoType(), GetEntry());
|
sLog.outError("GameObject::Use unhandled GameObject type %u (entry %u).", GetGoType(), GetEntry());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3112,20 +3112,13 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GAMEOBJECT_TYPE_CHEST:
|
case GAMEOBJECT_TYPE_CHEST:
|
||||||
// TODO: possible must be moved to loot release (in different from linked triggering)
|
gameObjTarget->Use(m_caster);
|
||||||
if (gameObjTarget->GetGOInfo()->chest.eventId)
|
|
||||||
{
|
|
||||||
sLog.outDebug("Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId,gameObjTarget->GetDBTableGUIDLow());
|
|
||||||
player->GetMap()->ScriptsStart(sEventScripts, gameObjTarget->GetGOInfo()->chest.eventId, player, gameObjTarget);
|
|
||||||
}
|
|
||||||
|
|
||||||
// triggering linked GO
|
|
||||||
if (uint32 trapEntry = gameObjTarget->GetGOInfo()->chest.linkedTrapId)
|
|
||||||
gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster);
|
|
||||||
|
|
||||||
// Don't return, let loots been taken
|
// Don't return, let loots been taken
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
sLog.outError("Spell::SendLoot unhandled GameObject type %u (entry %u).", gameObjTarget->GetGoType(), gameObjTarget->GetEntry());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9203"
|
#define REVISION_NR "9204"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue