Core/Scripts: Merged ZoneScript::ProcessEvent methods into one accepting WorldObject* parameter

This commit is contained in:
Shauren
2011-07-22 21:52:53 +02:00
parent ba4c4d8943
commit 7303adf1eb
5 changed files with 8 additions and 22 deletions
+1 -4
View File
@@ -21,8 +21,6 @@
#include "Common.h" #include "Common.h"
#include "Creature.h" #include "Creature.h"
//struct CreatureData;
class Creature;
class GameObject; class GameObject;
class ZoneScript class ZoneScript
@@ -49,8 +47,7 @@ class ZoneScript
virtual uint32 GetData(uint32 /*DataId*/) { return 0; } virtual uint32 GetData(uint32 /*DataId*/) { return 0; }
virtual void SetData(uint32 /*DataId*/, uint32 /*Value*/) {} virtual void SetData(uint32 /*DataId*/, uint32 /*Value*/) {}
virtual void ProcessEvent(GameObject* /*obj*/, uint32 /*eventId*/) {} virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/) {}
virtual void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/) {}
}; };
#endif #endif
@@ -138,11 +138,13 @@ public:
} }
} }
void ProcessEvent(GameObject* go, uint32 eventId) void ProcessEvent(WorldObject* obj, uint32 eventId)
{ {
if (eventId == EVENT_FOCUSING_IRIS) if (eventId == EVENT_FOCUSING_IRIS)
{ {
if (GameObject* go = obj->ToGameObject())
go->Delete(); // this is not the best way. go->Delete(); // this is not the best way.
if (Creature* malygos = instance->GetCreature(malygosGUID)) if (Creature* malygos = instance->GetCreature(malygosGUID))
malygos->GetMotionMaster()->MovePoint(4, 770.10f, 1275.33f, 267.23f); // MOVE_INIT_PHASE_ONE malygos->GetMotionMaster()->MovePoint(4, 770.10f, 1275.33f, 267.23f); // MOVE_INIT_PHASE_ONE
@@ -151,11 +153,6 @@ public:
} }
} }
// eliminate compile warning
void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/)
{
}
void VortexHandling() void VortexHandling()
{ {
if (Creature* malygos = instance->GetCreature(malygosGUID)) if (Creature* malygos = instance->GetCreature(malygosGUID))
@@ -83,11 +83,7 @@ public:
} }
} }
void ProcessEvent(GameObject* /*go*/, uint32 /*eventId*/) void ProcessEvent(WorldObject* /*unit*/, uint32 eventId)
{
}
void ProcessEvent(Unit* /*unit*/, uint32 eventId)
{ {
if (eventId != EVENT_CALL_DRAGON) if (eventId != EVENT_CALL_DRAGON)
return; return;
@@ -382,7 +382,7 @@ class instance_ulduar : public InstanceMapScript
} }
} }
void ProcessEvent(GameObject* /*gameObject*/, uint32 eventId) void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId)
{ {
// Flame Leviathan's Tower Event triggers // Flame Leviathan's Tower Event triggers
Creature* FlameLeviathan = instance->GetCreature(LeviathanGUID); Creature* FlameLeviathan = instance->GetCreature(LeviathanGUID);
@@ -795,7 +795,7 @@ public:
} }
} }
void ProcessEvent(GameObject* /*pGO*/, uint32 uiEventId) void ProcessEvent(WorldObject* /*pGO*/, uint32 uiEventId)
{ {
switch (uiEventId) switch (uiEventId)
{ {
@@ -805,10 +805,6 @@ public:
break; break;
} }
} }
void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/)
{
}
}; };
}; };