summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2020-07-06 18:14:13 +0000
committergumi <git@gumi.ca>2020-07-06 18:15:35 +0000
commit3949942605f6cfc32a5a14eb31285d06bcdcade6 (patch)
tree4644cbbc2259bfd1e0cfe561a6841ee090d90844
parent594eafd4f231a897cbefdd3dd9e74bb3794f9b95 (diff)
downloadtmwa-3949942605f6cfc32a5a14eb31285d06bcdcade6.tar.gz
tmwa-3949942605f6cfc32a5a14eb31285d06bcdcade6.tar.bz2
tmwa-3949942605f6cfc32a5a14eb31285d06bcdcade6.tar.xz
tmwa-3949942605f6cfc32a5a14eb31285d06bcdcade6.zip
fix formatting of the script nullpo macro
-rw-r--r--src/map/script-fun.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index b998899..610220d 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -75,18 +75,22 @@ namespace map
#define BUILTIN_NAME() (builtin_functions[st->stack->stack_datav[st->start].get_if<ScriptDataFuncRef>()->numi].name)
-#define script_nullpo_end(t, error) \
- if (nullpo_chk(__FILE__, __LINE__, __PRETTY_FUNCTION__, t)) { \
- if (st->oid) { \
- dumb_ptr<npc_data> nullpo_nd = map_id_is_npc(st->oid); \
- if (nullpo_nd && nullpo_nd->name) { \
- PRINTF("script:%s: " #error " @ %s\n"_fmt, BUILTIN_NAME(), nullpo_nd->name); \
- } else { \
- PRINTF("script:%s: " #error " (no npc)\n"_fmt, BUILTIN_NAME()); \
- } \
- } \
- st->state = ScriptEndState::END; \
- return; \
+#define script_nullpo_end(t, error) \
+ if (nullpo_chk(__FILE__, __LINE__, __PRETTY_FUNCTION__, t)) { \
+ if (st->oid) { \
+ dumb_ptr<npc_data> nullpo_nd = map_id_is_npc(st->oid); \
+ if (nullpo_nd && nullpo_nd->name) { \
+ PRINTF("script:%s: " #error " @ %s\n"_fmt, BUILTIN_NAME(), nullpo_nd->name); \
+ } else if (nullpo_nd) { \
+ PRINTF("script:%s: " #error " (unnamed npc)\n"_fmt, BUILTIN_NAME()); \
+ } else { \
+ PRINTF("script:%s: " #error " (no npc)\n"_fmt, BUILTIN_NAME()); \
+ } \
+ } else { \
+ PRINTF("script:%s: " #error " (no npc)\n"_fmt, BUILTIN_NAME()); \
+ } \
+ st->state = ScriptEndState::END; \
+ return; \
}
enum class MonsterAttitude