Changeset 146

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

[svn] Fix a bug that GameObject::CastSpell? crash the server.

Original author: megamage
Date: 2008-11-02 08:44:15-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/GameObject.cpp

    r145 r146  
    12721272    if(!trigger) return; 
    12731273 
    1274     Unit *owner = GetOwner(); 
    1275     if(owner) trigger->setFaction(owner->getFaction()); 
    1276     else trigger->setFaction(14); 
    12771274    trigger->SetVisibility(VISIBILITY_OFF); //should this be true? 
    1278     trigger->CastSpell(target, spell, true, 0, 0, owner->GetGUID()); 
    1279 } 
     1275    if(Unit *owner = GetOwner()) 
     1276    { 
     1277        trigger->setFaction(owner->getFaction()); 
     1278        trigger->CastSpell(target, spell, true, 0, 0, owner->GetGUID()); 
     1279    } 
     1280    else 
     1281    { 
     1282        trigger->setFaction(14); 
     1283        trigger->CastSpell(target, spell, true); 
     1284    } 
     1285}