mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[10304] Use loop instead repeating code in models check.
This commit is contained in:
parent
787fb83763
commit
c138fbe902
2 changed files with 6 additions and 20 deletions
|
|
@ -992,23 +992,9 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||||
if (displayId != cinfo->ModelId[0] && displayId != cinfo->ModelId[1] &&
|
if (displayId != cinfo->ModelId[0] && displayId != cinfo->ModelId[1] &&
|
||||||
displayId != cinfo->ModelId[2] && displayId != cinfo->ModelId[3])
|
displayId != cinfo->ModelId[2] && displayId != cinfo->ModelId[3])
|
||||||
{
|
{
|
||||||
if (cinfo->ModelId[0])
|
for(int i = 0; i < MAX_CREATURE_MODEL && displayId; ++i)
|
||||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->ModelId[0]))
|
if (cinfo->ModelId[i])
|
||||||
if (displayId == minfo->modelid_other_gender)
|
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->ModelId[i]))
|
||||||
displayId = 0;
|
|
||||||
|
|
||||||
if (displayId && cinfo->ModelId[1])
|
|
||||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->ModelId[1]))
|
|
||||||
if (displayId == minfo->modelid_other_gender)
|
|
||||||
displayId = 0;
|
|
||||||
|
|
||||||
if (displayId && cinfo->ModelId[2])
|
|
||||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->ModelId[2]))
|
|
||||||
if (displayId == minfo->modelid_other_gender)
|
|
||||||
displayId = 0;
|
|
||||||
|
|
||||||
if (displayId && cinfo->ModelId[3])
|
|
||||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->ModelId[3]))
|
|
||||||
if (displayId == minfo->modelid_other_gender)
|
if (displayId == minfo->modelid_other_gender)
|
||||||
displayId = 0;
|
displayId = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10303"
|
#define REVISION_NR "10304"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue