*fix visibility for trigger creatures
NOTE: if you see any trigger (in player mode) with a visible model (DB bug), please report creature entry + modelid in bugtracker --HG-- branch : trunk
This commit is contained in:
@@ -414,7 +414,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
|
|||||||
SetPvP(false);
|
SetPvP(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: trigger creature is always not selectable
|
// trigger creature is always not selectable and can not be attacked
|
||||||
if (isTrigger())
|
if (isTrigger())
|
||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
|
||||||
@@ -1751,8 +1751,9 @@ bool Creature::IsVisibleInGridForPlayer(Player const* pl) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Trigger shouldn't be visible for players
|
// Trigger shouldn't be visible for players
|
||||||
if (isTrigger())
|
//if (isTrigger())
|
||||||
return false;
|
// return false;
|
||||||
|
// Rat: this makes no sense, triggers are always sent to players, but with invisible model and can not be attacked or targeted!
|
||||||
|
|
||||||
// Live player (or with not release body see live creatures or death creatures with corpse disappearing time > 0
|
// Live player (or with not release body see live creatures or death creatures with corpse disappearing time > 0
|
||||||
if (pl->isAlive() || pl->GetDeathTimer() > 0)
|
if (pl->isAlive() || pl->GetDeathTimer() > 0)
|
||||||
|
|||||||
+3
-3
@@ -585,14 +585,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
|||||||
if (target->isGameMaster())
|
if (target->isGameMaster())
|
||||||
{
|
{
|
||||||
if (cinfo->Modelid1)
|
if (cinfo->Modelid1)
|
||||||
*data << cinfo->Modelid1;
|
*data << cinfo->Modelid1;//Modelid1 is a visible model for gms
|
||||||
else
|
else
|
||||||
*data << 17519; // world invisible trigger's model
|
*data << 17519; // world invisible trigger's model
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cinfo->Modelid3)
|
if (cinfo->Modelid2)
|
||||||
*data << cinfo->Modelid3;
|
*data << cinfo->Modelid2;//Modelid2 is an invisible model for players
|
||||||
else
|
else
|
||||||
*data << 11686; // world invisible trigger's model
|
*data << 11686; // world invisible trigger's model
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user