diff options
| author | megamage <none@none> | 2009-04-27 21:23:42 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-04-27 21:23:42 -0500 |
| commit | 8f0fecd7e3830dae08dd04a85263883391e18bb2 (patch) | |
| tree | 55b8d40386813bb7304e6a7db5c2cb5da340926d /src/game | |
| parent | 2b753d0f23593849dc2b440406e6f7006c104c53 (diff) | |
*Fix build.
--HG--
branch : trunk
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/CreatureEventAI.cpp | 2 | ||||
| -rw-r--r-- | src/game/OutdoorPvP.cpp | 8 | ||||
| -rw-r--r-- | src/game/OutdoorPvPSI.cpp | 4 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 20 |
4 files changed, 19 insertions, 15 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index b201aafe4dd..4eebbcd3fc8 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -1057,7 +1057,7 @@ void CreatureEventAI::Reset() } break; //default: - //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro() + //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void EnterCombat() //(*i).Enabled = true; //(*i).Time = 0; //break; diff --git a/src/game/OutdoorPvP.cpp b/src/game/OutdoorPvP.cpp index d702ea6d047..97acf08ce8c 100644 --- a/src/game/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP.cpp @@ -83,7 +83,7 @@ bool OutdoorPvPObjective::AddObject(uint32 type, uint32 entry, uint32 map, float data.spawntimesecs = 0; data.animprogress = 100; data.spawnMask = 1; - data.go_state = 1; + data.go_state = GO_STATE_READY; objmgr.AddGameobjectToGrid(guid, &data); @@ -95,7 +95,7 @@ bool OutdoorPvPObjective::AddObject(uint32 type, uint32 entry, uint32 map, float if(!pMap) return true; GameObject * go = new GameObject; - if(!go->Create(guid,entry, pMap,PHASEMASK_NORMAL,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1)) + if(!go->Create(guid,entry, pMap,PHASEMASK_NORMAL,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) { sLog.outError("Gameobject template %u not found in database.", entry); delete go; @@ -238,7 +238,7 @@ bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, flo data.spawntimesecs = 1; data.animprogress = 100; data.spawnMask = 1; - data.go_state = 1; + data.go_state = GO_STATE_READY; objmgr.AddGameobjectToGrid(guid, &data); @@ -255,7 +255,7 @@ bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, flo return true; // add GO... GameObject * go = new GameObject; - if(!go->Create(guid,entry, pMap,PHASEMASK_NORMAL,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1)) + if(!go->Create(guid,entry, pMap,PHASEMASK_NORMAL,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) { sLog.outError("Gameobject template %u not found in database.", entry); delete go; diff --git a/src/game/OutdoorPvPSI.cpp b/src/game/OutdoorPvPSI.cpp index 2bd35ef5a54..bb4cd22edfa 100644 --- a/src/game/OutdoorPvPSI.cpp +++ b/src/game/OutdoorPvPSI.cpp @@ -202,7 +202,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId) Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr); if(!map) return true; - if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1)) + if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY)) { delete go; } @@ -228,7 +228,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId) Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr); if(!map) return true; - if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask() ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1)) + if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask() ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY)) { delete go; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 01cdcdcbf38..48b28179591 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9705,12 +9705,6 @@ void Unit::CombatStart(Unit* target) && !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled) { ((Creature*)target)->AI()->AttackStart(this); - ((Creature*)target)->AI()->EnterCombat(this); - if(((Creature*)target)->GetFormation()) - { - ((Creature*)target)->GetFormation()->MemberAttackStart((Creature*)target, this); - sLog.outDebug("Unit::CombatStart() calls CreatureGroups::MemberHasAttacked(this);"); - } } SetInCombatWith(target); @@ -9744,8 +9738,18 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - if(GetTypeId() != TYPEID_PLAYER && GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != IDLE_MOTION_TYPE) - ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); + if(GetTypeId() != TYPEID_PLAYER) + { + if(GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != IDLE_MOTION_TYPE) + ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); + if(enemy) + { + if(!((Creature*)this)->HasReactState(REACT_PASSIVE) && ((Creature*)this)->IsAIEnabled) + ((Creature*)this)->AI()->EnterCombat(enemy); + if(((Creature*)this)->GetFormation()) + ((Creature*)this)->GetFormation()->MemberAttackStart((Creature*)this, enemy); + } + } if(GetTypeId() != TYPEID_PLAYER && ((Creature*)this)->isPet()) { |
