TrinityCore
Loading...
Searching...
No Matches
MovementGenerator.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#include "
MovementGenerator.h
"
19
#include "
StringFormat.h
"
20
21
MovementGenerator::~MovementGenerator
()
22
{
23
// Ensure script doesn't get stuck waiting for this movement
24
SetScriptResult
(
MovementStopReason::Interrupted
);
25
}
26
27
std::string
MovementGenerator::GetDebugInfo
()
const
28
{
29
return
Trinity::StringFormat
(
"Mode: {} Priority: {} Flags: {} BaseUniteState: {}"
,
30
Mode
,
Priority
,
Flags
,
BaseUnitState
);
31
}
32
33
void
MovementGenerator::SetScriptResult
(
MovementStopReason
reason)
34
{
35
if
(
ScriptResult
)
36
{
37
ScriptResult
.
SetResult
(reason);
38
ScriptResult
.
Reset
();
39
}
40
}
MovementStopReason
MovementStopReason
Definition
MovementDefines.h:100
MovementStopReason::Interrupted
@ Interrupted
MovementGenerator.h
StringFormat.h
MovementGenerator::~MovementGenerator
virtual ~MovementGenerator()
Definition
MovementGenerator.cpp:21
MovementGenerator::SetScriptResult
void SetScriptResult(MovementStopReason reason)
Definition
MovementGenerator.cpp:33
MovementGenerator::BaseUnitState
uint32 BaseUnitState
Definition
MovementGenerator.h:88
MovementGenerator::Mode
uint8 Mode
Definition
MovementGenerator.h:85
MovementGenerator::Flags
uint16 Flags
Definition
MovementGenerator.h:87
MovementGenerator::Priority
uint8 Priority
Definition
MovementGenerator.h:86
MovementGenerator::ScriptResult
Scripting::v2::ActionResultSetter< MovementStopReason > ScriptResult
Definition
MovementGenerator.h:89
MovementGenerator::GetDebugInfo
virtual std::string GetDebugInfo() const
Definition
MovementGenerator.cpp:27
Scripting::v2::ActionResultSetter::Reset
void Reset()
Definition
ScriptActionResult.h:55
Scripting::v2::ActionResultSetter::SetResult
void SetResult(T result)
Definition
ScriptActionResult.h:44
Trinity::StringFormat
std::string StringFormat(FormatString< Args... > fmt, Args &&... args) noexcept
Default TC string format function.
Definition
StringFormat.h:57
server
game
Movement
MovementGenerator.cpp
Generated on Sun May 10 2026 02:09:00 for TrinityCore by
1.9.8