diff options
| author | Carbenium <carbenium@outlook.com> | 2020-07-26 20:44:07 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-24 11:55:32 +0100 |
| commit | 310f996b1daf9dea701276847aa3fb30fcd43b9e (patch) | |
| tree | 6016e31d8f9f3f439f4c35868cfcde4652a898b1 /src/server/game/AI | |
| parent | 906a47b1616eebe1b9f73f0b5a849c5d946e8137 (diff) | |
Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0);
to
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s);
(cherry picked from commit 1131229ee9c43704b11187f0b11c327db92018b6)
Diffstat (limited to 'src/server/game/AI')
| -rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/AI/CreatureAI.h | 2 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index e4048e907a6..be33c4d1904 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -335,7 +335,7 @@ const float BOUNDARY_VISUALIZE_CREATURE_SCALE = 0.25f; const int8 BOUNDARY_VISUALIZE_STEP_SIZE = 1; const int32 BOUNDARY_VISUALIZE_FAILSAFE_LIMIT = 750; const float BOUNDARY_VISUALIZE_SPAWN_HEIGHT = 5.0f; -int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) const +int32 CreatureAI::VisualizeBoundary(Seconds duration, Unit* owner, bool fill) const { typedef std::pair<int32, int32> coordinate; @@ -393,7 +393,7 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con } if (fill || hasOutOfBoundsNeighbor) { - if (TempSummon* point = owner->SummonCreature(BOUNDARY_VISUALIZE_CREATURE, Position(startPosition.GetPositionX() + front.first * BOUNDARY_VISUALIZE_STEP_SIZE, startPosition.GetPositionY() + front.second * BOUNDARY_VISUALIZE_STEP_SIZE, spawnZ), TEMPSUMMON_TIMED_DESPAWN, duration * IN_MILLISECONDS)) + if (TempSummon* point = owner->SummonCreature(BOUNDARY_VISUALIZE_CREATURE, Position(startPosition.GetPositionX() + front.first * BOUNDARY_VISUALIZE_STEP_SIZE, startPosition.GetPositionY() + front.second * BOUNDARY_VISUALIZE_STEP_SIZE, spawnZ), TEMPSUMMON_TIMED_DESPAWN, duration)) { point->SetObjectScale(BOUNDARY_VISUALIZE_CREATURE_SCALE); point->AddUnitFlag(UNIT_FLAG_STUNNED); diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 53f2e71e2bf..d246b4124d0 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -230,7 +230,7 @@ class TC_GAME_API CreatureAI : public UnitAI virtual PlayerAI* GetAIForCharmedPlayer(Player* /*who*/) { return nullptr; } // intended for encounter design/debugging. do not use for other purposes. expensive. - int32 VisualizeBoundary(uint32 duration, Unit* owner = nullptr, bool fill = false) const; + int32 VisualizeBoundary(Seconds duration, Unit* owner = nullptr, bool fill = false) const; // boundary system methods virtual bool CheckInRoom(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 12608afc461..7c8ecfae7f9 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -284,7 +284,7 @@ void ScriptedAI::ForceCombatStopForCreatureEntry(std::vector<uint32> creatureEnt Creature* ScriptedAI::DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, Milliseconds despawntime) { - return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime.count()); + return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime); } bool ScriptedAI::HealthBelowPct(uint32 pct) const diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 874f5efd70a..5c299c617a3 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1285,7 +1285,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u y += e.target.y; z += e.target.z; o += e.target.o; - if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration, privateObjectOwner)) + if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, Milliseconds(e.action.summonCreature.duration), privateObjectOwner)) if (e.action.summonCreature.attackInvoker) summon->AI()->AttackStart(target->ToUnit()); } @@ -1293,7 +1293,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.GetTargetType() != SMART_TARGET_POSITION) break; - if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration, privateObjectOwner)) + if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, Milliseconds(e.action.summonCreature.duration), privateObjectOwner)) if (unit && e.action.summonCreature.attackInvoker) summon->AI()->AttackStart(unit); break; |
