Skip to content

Commit

Permalink
[12104] Fix some bugs, thanks to LordPsyan for pointing
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Schmoozerd committed Aug 18, 2012
1 parent 4063259 commit 5bb227c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/game/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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).
// 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]);
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])
{
Expand Down
5 changes: 3 additions & 2 deletions src/game/OutdoorPvP/OutdoorPvPMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ OutdoorPvPMgr::~OutdoorPvPMgr()
#define LOAD_OPVP_ZONE(a) \
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; \
}
/**
Expand Down Expand Up @@ -160,7 +160,8 @@ void OutdoorPvPMgr::Update(uint32 diff)
return;

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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12103"
#define REVISION_NR "12104"
#endif // __REVISION_NR_H__

0 comments on commit 5bb227c

Please sign in to comment.