Changeset 92

Show
Ignore:
Timestamp:
11/19/08 13:34:48 (17 years ago)
Author:
yumileroy
Message:

[svn] Fixed win32 compile
Null pointer checks in the barrens ai.

Original author: w12x
Date: 2008-10-21 14:31:24-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp

    r90 r92  
    288288                    for(uint8 i = 0; i < 6; i++) { 
    289289                        Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); 
     290                        if(!pCreature) 
     291                            continue; 
    290292                        pCreature->setFaction(35); 
    291293                        pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     
    317319                        DoYell(SAY_TWIGGY_FLATHEAD_FRAY,LANG_UNIVERSAL,NULL); 
    318320                        Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]); 
    319                         if(pCreature || (pCreature->isAlive())) { 
     321                        if(pCreature && (pCreature->isAlive())) { 
    320322                            pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
    321323                            pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 
     
    328330                    } 
    329331                    else if (Wave >= 6 && !EventBigWill) { 
    330                         Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000); 
    331                         BigWill = pCreature->GetGUID(); 
    332                         //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32); 
    333                         //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78); 
    334                         pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79); 
    335                         //pCreature->HandleEmoteCommand(15); 
    336                         pCreature->HandleEmoteCommand(27); 
    337                         EventBigWill = true; 
    338                         Wave_Timer = 1000; 
     332                        if(Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) 
     333                        { 
     334                            BigWill = pCreature->GetGUID(); 
     335                            //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32); 
     336                            //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78); 
     337                            pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79); 
     338                            //pCreature->HandleEmoteCommand(15); 
     339                            pCreature->HandleEmoteCommand(27); 
     340                            EventBigWill = true; 
     341                            Wave_Timer = 1000; 
     342                        } 
    339343                    } 
    340344                    else if (Wave >= 6 && EventBigWill && BigWill) { 
    341345                        Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill); 
    342                         if (!pCreature->isAlive()) { 
     346                        if (!pCreature || !pCreature->isAlive()) { 
    343347                            DoYell(SAY_TWIGGY_FLATHEAD_OVER,LANG_UNIVERSAL,NULL); 
    344348                            EventInProgress = false;