mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[12104] Fix some bugs, thanks to LordPsyan for pointing
* Fix an inconsistence between comment and code for model selection * Improve the macro from recent commit to work with stricter gcc preprocessors * Fix a bug that caused a crash for not loaded outdoorPvp scripts
This commit is contained in:
parent
104881706b
commit
7e70e39b9b
3 changed files with 5 additions and 4 deletions
|
|
@ -438,7 +438,7 @@ uint32 Creature::ChooseDisplayId(const CreatureInfo* cinfo, const CreatureData*
|
||||||
// Where it's expected to select one of two, model must have a alternative model defined (alternative model is normally the same as defined in ModelId1).
|
// Where it's expected to select one of two, model must have a alternative model defined (alternative model is normally the same as defined in ModelId1).
|
||||||
// Same pattern is used in the above model selection, but the result may be ModelId3 and not ModelId2 as here.
|
// Same pattern is used in the above model selection, but the result may be ModelId3 and not ModelId2 as here.
|
||||||
uint32 modelid_tmp = sObjectMgr.GetCreatureModelAlternativeModel(cinfo->ModelId[1]);
|
uint32 modelid_tmp = sObjectMgr.GetCreatureModelAlternativeModel(cinfo->ModelId[1]);
|
||||||
display_id = modelid_tmp ? modelid_tmp : cinfo->ModelId[1];
|
display_id = modelid_tmp ? cinfo->ModelId[urand(0, 1)] : cinfo->ModelId[1];
|
||||||
}
|
}
|
||||||
else if (cinfo->ModelId[0])
|
else if (cinfo->ModelId[0])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ OutdoorPvPMgr::~OutdoorPvPMgr()
|
||||||
#define LOAD_OPVP_ZONE(a) \
|
#define LOAD_OPVP_ZONE(a) \
|
||||||
if (sWorld.getConfig(CONFIG_BOOL_OUTDOORPVP_##a##_ENABLED)) \
|
if (sWorld.getConfig(CONFIG_BOOL_OUTDOORPVP_##a##_ENABLED)) \
|
||||||
{ \
|
{ \
|
||||||
m_scripts[OPVP_ID_##a##] = new OutdoorPvP##a##(); \
|
m_scripts[OPVP_ID_##a] = new OutdoorPvP##a(); \
|
||||||
++counter; \
|
++counter; \
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
@ -160,7 +160,8 @@ void OutdoorPvPMgr::Update(uint32 diff)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (uint8 i = 0; i < MAX_OPVP_ID; ++i)
|
for (uint8 i = 0; i < MAX_OPVP_ID; ++i)
|
||||||
(*m_scripts[i]).Update(m_updateTimer.GetCurrent());
|
if (m_scripts[i])
|
||||||
|
m_scripts[i]->Update(m_updateTimer.GetCurrent());
|
||||||
|
|
||||||
m_updateTimer.Reset();
|
m_updateTimer.Reset();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "0140"
|
#define REVISION_NR "12104"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue