diff options
Diffstat (limited to 'src/map/magic.cpp')
-rw-r--r-- | src/map/magic.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/map/magic.cpp b/src/map/magic.cpp index 9896b26..b899a5e 100644 --- a/src/map/magic.cpp +++ b/src/map/magic.cpp @@ -1,3 +1,4 @@ +#include "magic.hpp" // magic.cpp - Entry to the magic system. // // Copyright © 2004-2011 The Mana World Development Team @@ -18,23 +19,27 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cstring> +#include <algorithm> +#include <utility> #include "../strings/xstring.hpp" -#include "../io/cxxstdio.hpp" - -#include "magic-interpreter.hpp" +#include "../generic/dumb_ptr.hpp" -#include "pc.hpp" +#include "../io/cxxstdio.hpp" #include "magic-expr.hpp" +#include "magic-interpreter.hpp" #include "magic-interpreter-base.hpp" #include "magic-stmt.hpp" -#include "magic.hpp" +#include "map.hpp" +#include "pc.hpp" #include "../poison.hpp" + +namespace tmwa +{ #undef DEBUG /// Return a pair of strings, {spellname, parameter} @@ -95,15 +100,15 @@ int magic_message(dumb_ptr<map_session_data> caster, XString source_invocation) if (bool(spell->flags & SPELL_FLAG::NONMAGIC) || (power >= 1)) effects = spell_trigger(spell, caster, env, &near_miss); else - effects = NULL; + effects = nullptr; #ifdef DEBUG - FPRINTF(stderr, "Found spell `%s', triggered = %d\n", spell_, - effects != NULL); + FPRINTF(stderr, "Found spell `%s', triggered = %d\n"_fmt, spell_, + effects != nullptr); #endif - MAP_LOG_PC(caster, "CAST %s %s", - spell->name, effects ? "SUCCESS" : "FAILURE"); + MAP_LOG_PC(caster, "CAST %s %s"_fmt, + spell->name, effects ? "SUCCESS"_s : "FAILURE"_s); if (effects) { @@ -122,3 +127,4 @@ int magic_message(dumb_ptr<map_session_data> caster, XString source_invocation) return 0; /* Not a spell */ } +} // namespace tmwa |