| 357 | } |
| 358 | |
| 359 | bool map_lua_marker::notify_dgn_event(const dgn_event &e) |
| 360 | { |
| 361 | lua_stack_cleaner clean(dlua); |
| 362 | push_fn_args("event"); |
| 363 | clua_push_dgn_event(dlua, &e); |
| 364 | if (!dlua.callfn("dlua_marker_method", 4, 1)) |
| 365 | { |
| 366 | mprf(MSGCH_ERROR, "notify_dgn_event: Lua error: %s", |
| 367 | dlua.error.c_str()); |
| 368 | |
| 369 | // Lua error prevents veto if the event is vetoable. |
| 370 | return true; |
| 371 | } |
| 372 | |
| 373 | bool accepted = true; |
| 374 | |
| 375 | // We accept only a real boolean false as a veto. |
| 376 | if (lua_isboolean(dlua, -1)) |
| 377 | accepted = lua_toboolean(dlua, -1); |
| 378 | |
| 379 | return accepted; |
| 380 | } |
| 381 | |
| 382 | string map_lua_marker::call_str_fn(const char *fn) const |
| 383 | { |
no test coverage detected